summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorrubenwardy <rubenwardy@gmail.com>2014-05-20 15:21:09 +0100
committerShadowNinja <shadowninja@minetest.net>2014-05-26 18:41:58 -0400
commit832d7973c8028d743eb331cb3d499692cebdc724 (patch)
treec7f8fd191e5d981b3fc71c7ee726fe86dc158854 /doc
parentab75b1b923db157a7d05c5498456a0fd1faee883 (diff)
downloadminetest-832d7973c8028d743eb331cb3d499692cebdc724.tar.gz
minetest-832d7973c8028d743eb331cb3d499692cebdc724.tar.bz2
minetest-832d7973c8028d743eb331cb3d499692cebdc724.zip
Add item eat callback
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 164aa393e..803314925 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -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)