From 524da8a6cb15ab1527598662a027e1cf587b4cca Mon Sep 17 00:00:00 2001 From: SumianVoice Date: Tue, 19 Jul 2022 14:38:32 +1000 Subject: [PATCH] move heal under tame so that you can tame an animal and then heal it, like in MC --- mods/ENTITIES/mcl_mobs/api.lua | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 39c10e561..3ff508554 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -4369,6 +4369,16 @@ function mcl_mobs:feed_tame(self, clicker, feed_count, breed, tame, notake) if self.nofollow or follow_holding(self, clicker) then local consume_food = false + -- feed and tame + + if tame then + self.tamed = true + if not self.owner or self.owner == "" then + self.owner = clicker:get_player_name() + consume_food = true + end + end + -- increase health if self.health < self.hp_max then @@ -4381,17 +4391,6 @@ function mcl_mobs:feed_tame(self, clicker, feed_count, breed, tame, notake) self.object:set_hp(self.health) end - -- feed and tame - - if tame then - self.tamed = true - if not self.owner or self.owner == "" then - self.owner = clicker:get_player_name() - consume_food = true - end - end - - if breed and not self.child and not consume_food and self.hornytimer == 0 and not self.horny then self.food = (self.food or 0) + 1