From fbfc53ff42b18c7bcfd6436beaea2036de75cb3f Mon Sep 17 00:00:00 2001 From: Sumyjkl Date: Wed, 20 Jul 2022 14:13:54 +1000 Subject: [PATCH] eat sound will play even when feeding in creative --- mods/ENTITIES/mcl_mobs/api.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 8a583c96e1..99af36e09f 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -4429,18 +4429,18 @@ function mcl_mobs:feed_tame(self, clicker, feed_count, breed, tame, notake) update_tag(self) -- if not in creative then take item if it was used - if not minetest.is_creative_enabled(clicker:get_player_name()) and consume_food then - - local item = clicker:get_wielded_item() - - if not notake then + if consume_food then + -- don't consume food if clicker is in creative + if not minetest.is_creative_enabled(clicker:get_player_name()) and not notake then + local item = clicker:get_wielded_item() item:take_item() - mob_sound(self, "eat", nil, true) + clicker:set_wielded_item(item) end + -- always play the eat sound if food is used, even in creative + mob_sound(self, "eat", nil, true) - clicker:set_wielded_item(item) else - -- make sound when fed so many times + -- make sound when the mob doesn't want food mob_sound(self, "random", true) end return true