From dbe712bc17cc875c5e9b4b1a919880b0f6893ea1 Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Sat, 24 Apr 2021 00:23:33 -0400 Subject: [PATCH] Make llama breedable --- mods/ENTITIES/mobs_mc/llama.lua | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/llama.lua b/mods/ENTITIES/mobs_mc/llama.lua index 81120dfdd..cd3b1ea2c 100644 --- a/mods/ENTITIES/mobs_mc/llama.lua +++ b/mods/ENTITIES/mobs_mc/llama.lua @@ -58,6 +58,9 @@ mobs:register_mob("mobs_mc:llama", { walk_velocity = 1, run_velocity = 4.4, follow_velocity = 4.4, + breed_distance = 1.5, + baby_size = 0.5, + follow_distance = 2, floats = 1, reach = 6, drops = { @@ -92,7 +95,7 @@ mobs:register_mob("mobs_mc:llama", { look_start = 78, look_end = 108, }, - follow = mobs_mc.follow.llama, + follow = mobs_mc.items.hay_bale, view_range = 16, do_custom = function(self, dtime) @@ -135,15 +138,18 @@ mobs:register_mob("mobs_mc:llama", { return end - local item = clicker:get_wielded_item() - if item:get_name() == mobs_mc.items.hay_bale then - -- Breed with hay bale - if mobs:feed_tame(self, clicker, 1, true, false) then return end - else - -- Feed with anything else - if mobs:feed_tame(self, clicker, 1, false, true) then return end + --attempt to enter breed state + if mobs.enter_breed_state(self,clicker) then + return end + --make baby grow faster + if self.baby then + mobs.make_baby_grow_faster(self,clicker) + return + end + + -- Make sure tamed llama is mature and being clicked by owner only if self.tamed and not self.child and self.owner == clicker:get_player_name() then