diff --git a/mods/ENTITIES/mcl_mobs/api/api.lua b/mods/ENTITIES/mcl_mobs/api/api.lua index 1819ce060..fcec54177 100644 --- a/mods/ENTITIES/mcl_mobs/api/api.lua +++ b/mods/ENTITIES/mcl_mobs/api/api.lua @@ -345,6 +345,7 @@ function mobs:register_mob(name, def) fire_resistant = def.fire_resistant or false, fire_damage_resistant = def.fire_damage_resistant or false, ignited_by_sunlight = def.ignited_by_sunlight or false, + eye_height = def.eye_height or 1.5, -- End of MCL2 extensions on_spawn = def.on_spawn, diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua index 1c15f3a58..8dbe49a97 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua @@ -574,9 +574,7 @@ mobs.mob_step = function(self, dtime) if self.hostile then --true for line_of_sight is debug - --10 for radius is debug - --1 for eye height adjust is debug - local attacking = mobs.detect_closest_player_within_radius(self,true,10,1) + local attacking = mobs.detect_closest_player_within_radius(self,true,self.view_range,self.eye_height) --go get the closest player ROAR >:O if attacking then diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/attack_type_instructions.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/attack_type_instructions.lua index 0f4d2bcb1..34a87a745 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/attack_type_instructions.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/attack_type_instructions.lua @@ -107,6 +107,15 @@ mobs.punch_attack_walk = function(self,dtime) mobs.set_mob_animation(self, "run") + --make punchy mobs jump + --check for nodes to jump over + --explosive mobs will just ride against walls for now + local node_in_front_of = mobs.jump_check(self) + if node_in_front_of == 1 then + mobs.jump(self) + end + + if self.punch_timer > 0 then self.punch_timer = self.punch_timer - dtime end diff --git a/mods/ENTITIES/mobs_mc/creeper.lua b/mods/ENTITIES/mobs_mc/creeper.lua index 830a51daf..8bb0897c7 100644 --- a/mods/ENTITIES/mobs_mc/creeper.lua +++ b/mods/ENTITIES/mobs_mc/creeper.lua @@ -41,7 +41,7 @@ mobs:register_mob("mobs_mc:creeper", { run_velocity = 2.1, runaway_from = { "mobs_mc:ocelot", "mobs_mc:cat" }, attack_type = "explode", - + eye_height = 1.25, --hssssssssssss explosion_strength = 10, diff --git a/mods/ENTITIES/mobs_mc/zombie.lua b/mods/ENTITIES/mobs_mc/zombie.lua index 93550a42a..915f12e7b 100644 --- a/mods/ENTITIES/mobs_mc/zombie.lua +++ b/mods/ENTITIES/mobs_mc/zombie.lua @@ -71,6 +71,7 @@ local zombie = { damage = "mobs_mc_zombie_hurt", distance = 16, }, + eye_height = 1.65, walk_velocity = 1, run_velocity = 3, damage = 3,