From 81713a342d8038c2b51140dbd4bc00f1440b73e8 Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Sat, 24 Apr 2021 00:38:50 -0400 Subject: [PATCH] Allow tamed wolves to be shift click bred --- mods/ENTITIES/mobs_mc/wolf.lua | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mobs_mc/wolf.lua b/mods/ENTITIES/mobs_mc/wolf.lua index aad4db037..4cd76dd32 100644 --- a/mods/ENTITIES/mobs_mc/wolf.lua +++ b/mods/ENTITIES/mobs_mc/wolf.lua @@ -76,6 +76,7 @@ local wolf = { dog:set_yaw(yaw) ent = dog:get_luaentity() ent.owner = clicker:get_player_name() + ent.tamed = true -- cornfirm taming minetest.sound_play("mobs_mc_wolf_bark", {object=dog, max_hear_distance=16}, true) -- Replace wolf @@ -143,12 +144,29 @@ dog.owner_loyal = true dog.follow_velocity = 3.2 -- Automatically teleport dog to owner dog.do_custom = mobs_mc.make_owner_teleport_function(12) -dog.follow = mobs_mc.follow.dog dog.attack_animals = nil dog.specific_attack = nil +dog.breed_distance = 1.5 +dog.baby_size = 0.5 +dog.follow_distance = 2 +dog.follow = "mcl_mobitems:beef" + dog.on_rightclick = function(self, clicker) local item = clicker:get_wielded_item() + if self.owner and self.owner == clicker:get_player_name() and clicker:get_player_control().sneak then + --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 + end + if is_food(item:get_name()) then -- Feed to increase health local hp = self.health