In my veggies mod you eat stuff and that goes to the food, food hud, etc, but when i eat an apple it doesn't go to the food hud because in the default/nodes it is on_use item_eat.
I need to make it do my on_use function, not the one in the default.
Is there an, um, i don't know what to call it...extensibility?...for the apple definition in default/nodes?
Like can i just redefine the apple with veggies:apple (i tried 'default:apple' and the loader freaked) and will it over-lay the default one?
Thanks,
leetelate
veggies mod download is http://1337318.zymichost.com/veggies.tar.gz
"Minetest is the smarter brother of Minecraft"
edit: nope, veggie:apple redefinition doesn't work - can i mess with the registered node definitions (muhwahhahahaha)?
AHA!!! Oh Minetest, you just make my heart flutter!!! https://github.com/Uberi/MineTest-API/wiki/registry - minetest is definitely the smarter brother of minecraft - people just play minecraft, minetest is indeed exstensible - time to fess with the apple nodedef and make it do my bidding! muhwahhahahaha!
yes! it works!!!
----apple on_use clone hack
local node = {}
for k,v in pairs(minetest.registered_nodes["default:apple"]) do node[k] = v end
node.on_use = function(itemstack, user, pointed_thing)
eatit(user,2)
itemstack:take_item(1)
return itemstack
end, --function
minetest.register_node(":default:apple", node)
SOLVED