[Help] get_nodedef_field
I implemented get_nodedef_field and it doesn't work.
So i converted it to a more simple and not generical function on what i need:
i implemented it with:
And:
And it gives me nil value or air value.
Can you help me out?
So i converted it to a more simple and not generical function on what i need:
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
local function getdrops(nodename)
if not minetest.registered_nodes[nodename] then
return nil
end
return minetest.registered_nodes[nodename]["drop"]
end
i implemented it with:
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
local drop1 = getdrops(nodepos.name)
And:
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
if drop1 ~= 'air' then
inv:add_item("main", drop1)
end
And it gives me nil value or air value.
Can you help me out?