Puncher player name

Post Reply
User avatar
tima_gt
Member
Posts: 22
Joined: Mon Jun 10, 2013 13:19

Puncher player name

by tima_gt » Post

How to get player name who punched/right clicked a block?

User avatar
Krock
Developer
Posts: 4597
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Puncher player name

by Krock » Post

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,
})
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests