From 832d7973c8028d743eb331cb3d499692cebdc724 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Tue, 20 May 2014 15:21:09 +0100 Subject: Add item eat callback --- doc/lua_api.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc') 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) -- cgit v1.2.3