diff --git a/mods/hunger/functions.lua b/mods/hunger/functions.lua index d3c8af31..dc157f52 100644 --- a/mods/hunger/functions.lua +++ b/mods/hunger/functions.lua @@ -169,6 +169,11 @@ function hunger.register_food(name, hunger_change, replace_with_item, poisen, he food[name].poisen = poisen -- time its poisening food[name].healing = heal -- amount of HP food[name].sound = sound -- special sound that is played when eating + -- copied overwrite + local def = minetest.registered_items[name] + if not def then return end + def.on_use = hunger.item_eat(hunger_change, replace_with_item, poisen, heal, sound) + minetest.registered_items[name] = def end -- Poison player