if itemstack:take_item() ~= nil then
user:set_hp(user:get_hp() + hp_change)
+ local def = itemstack:get_definition()
+ if def and def.sound and def.sound.eat then
+ minetest.sound_play(def.sound.eat, { pos = user:get_pos(), max_hear_distance = 16 })
+ end
+
if replace_with_item then
if itemstack:is_empty() then
itemstack:add_item(replace_with_item)
sound = {
breaks = "default_tool_break", -- tools only
place = <SimpleSoundSpec>,
+ eat = <SimpleSoundSpec>,
},
on_place = func(itemstack, placer, pointed_thing),