minetest.register on item eat

Description

 * Available in '0.4.10+''

Registers a callback that is called when an item is eaten, by minetest.item_eat. Return  or an ItemStack from the callback to cancel the default item east response (e.g. HP increase).


 * — The HP change due to eating the item, from.
 * — Replacement for the item, for use in .  Can be nil.
 * — The itemstack holding the item being eaten, from the  callback.
 * — The Player object for the player eating the item, from the  callback.
 * — Where the player is looking while eating the item, from the  callback.