1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Add item eat callback

This commit is contained in:
rubenwardy 2014-05-20 15:21:09 +01:00 committed by ShadowNinja
parent ab75b1b923
commit 832d7973c8
3 changed files with 11 additions and 1 deletions

View file

@ -1313,6 +1313,9 @@ minetest.register_on_protection_violation(func(pos, name))
^ The provided function should check that the position is protected by the mod
calling this function before it prints a message, if it does, to allow for
multiple protection mods.
minetest.register_on_item_eat(func(hp_change, replace_with_item, itemstack, user, pointed_thing))
^ Called when an item is eaten, by minetest.item_eat
^ Return true or itemstack to cancel the default item eat response (ie: hp increase)
Other registration functions:
minetest.register_chatcommand(cmd, chatcommand definition)