Page 1 of 1

Puncher player name

Posted: Sat Nov 07, 2015 05:10
by tima_gt
How to get player name who punched/right clicked a block?

Re: Puncher player name

Posted: Sat Nov 07, 2015 14:18
by Krock
You can extend the node definition to get the puncher's name:

Code: Select all

minetest.register_node("my_mod:my_node", {
	[...]
	on_punch = function(pos, node, puncher)
		local player_name = puncher:get_player_name()
	end,
	on_rightclick = function(pos, node, clicker)
		local player_name = clicker:get_player_name()
	end,
})