From d41d29be58c8b69797e8e615e852f85d5173e00f Mon Sep 17 00:00:00 2001 From: Eliy21 Date: Thu, 18 Jan 2024 16:33:15 +0000 Subject: [PATCH] Add distinction between regular sized mobs and large mobs in the cactus mob damage area reach --- mods/ENTITIES/mcl_mobs/physics.lua | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/physics.lua b/mods/ENTITIES/mcl_mobs/physics.lua index 3ca6b6122..071e96631 100644 --- a/mods/ENTITIES/mcl_mobs/physics.lua +++ b/mods/ENTITIES/mcl_mobs/physics.lua @@ -770,7 +770,29 @@ function mob_class:do_env_damage() -- is mob touching the cactus? local dist = vector.distance(pos, near) local dist_feet = vector.distance({x=pos.x, y=pos.y-1, z=pos.z}, near) - if dist < 1.25 or dist_feet < 1.9 then + local large_mob = false + if self.name == "mobs_mc:ender_dragon" or + self.name == "mobs_mc:ghast" or + self.name == "mobs_mc:guardian_elder" or + self.name == "mobs_mc:hoglin" or + self.name == "mobs_mc:zoglin" or + self.name == "mobs_mc:horse" or + self.name == "mobs_mc:skeleton_horse" or + self.name == "mobs_mc:zombie_horse" or + self.name == "mobs_mc:donkey" or + self.name == "mobs_mc:mule" or + self.name == "mobs_mc:iron_golem" or + self.name == "mobs_mc:polar_bear" or + self.name == "mobs_mc:slime_big" or + self.name == "mobs_mc:magma_cube_big" or + self.name == "mobs_mc:spider" or + self.name == "mobs_mc:cave_spider" or + self.name == "mobs_mc:strider" or + self.name == "mobs_mc:wither" then + + large_mob = true + end + if (not large_mob and (dist < 1.03 or dist_feet < 1.6)) or (large_mob and (1.25 or dist_feet < 1.9)) then if self.health ~= 0 then self:damage_mob("cactus", 2)