[Solved] Weird not-nodename result

KCoombes
Member
 
Posts: 398
Joined: Thu Jun 11, 2015 23:19
Location: SW Florida, USA
In-game: Knatt

[Solved] Weird not-nodename result

by KCoombes » Wed Mar 28, 2018 20:48

OK, latest wth moment:

Code: Select all
minetest.register_on_dignode(function(pos, oldnode, digger)
local name = digger:get_player_name()
print ("I am", name)
local wield = digger:get_wielded_item()
print ("I am using", wield)
local used = minetest.get_item_group(wield, "tool")
print("Tool group is", used)


This code results in
I am singleplayer
I am using userdata:0x02857048 <-- I expected the nodename
Tool group is 0

How can I convert that 'userdata' reference to the nodename?
 

User avatar
rubenwardy
Moderator
 
Posts: 5428
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
 

KCoombes
Member
 
Posts: 398
Joined: Thu Jun 11, 2015 23:19
Location: SW Florida, USA
In-game: Knatt

Re: Weird not-nodename result

by KCoombes » Wed Mar 28, 2018 20:52

Once again to my rescue - thanks Rubenwardy!
 


Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 2 guests