Puncher player name

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

Puncher player name

by tima_gt » Sat Nov 07, 2015 05:10

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

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: Puncher player name

by Krock » Sat Nov 07, 2015 14:18

You can extend the node definition to get the puncher's name:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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,
})
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 15 guests

cron