Reading the item/tool definition of the hand

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Reading the item/tool definition of the hand

by Wuzzy » Sun Jul 24, 2016 13:32

Hi.
I know I can read the definitions of pretty much all nodes, items, tools by using e.g. minetest.registered_tools.

However, this seems to be not the case for the hand (default tool). The identifier for the hand is the colon.
I know you can define it with something like this:
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_item(":", definition)


However, reading the information back seems not to be possible. I have tried to read the following entries but each of them were nil:

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.registered_tools[":"]

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.registered_items[":"]

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.registered_craftitems[":"]


My question is: How can I read the tool or item definition of the hand?
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Reading the item/tool definition of the hand

by rubenwardy » Sun Jul 24, 2016 14:06

: is the override character. The name of the hand is "".

: Basically disables the name check, so names don't have to be of form modname:itemname it also disables existence checks, so that you can overwrite existing nodes
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: Reading the item/tool definition of the hand

by Wuzzy » Sun Jul 24, 2016 16:46

Thanks, this was the answer.

I wonder if many people in Minetest would have asked the same or a similar question (just give a short shout-out if this applies to you). I am considering of adding this one to the FAQ, but only if it is really frequently asked (at least in theory). ;-)

PS: Is the fact that the ID of the hand is the empty string mentioned in lua_api.txt somewhere?
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 28 guests