From de4c40f60aedb54db747c7a8fbb07b481e16c91e Mon Sep 17 00:00:00 2001 From: epCode Date: Tue, 25 Oct 2022 18:57:58 +0000 Subject: [PATCH] When mobs stop, don't stop animations easier fixes mob punch animation. --- mods/ENTITIES/mcl_mobs/api.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index f2016f69c..77740a548 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -4001,7 +4001,11 @@ local mob_step = function(self, dtime) if not self.animation.walk_speed then self.animation.walk_speed = 25 end - self.object:set_animation_frame_speed((v2/math.max(1,self.run_velocity))*self.animation.walk_speed*self.frame_speed_multiplier) + if abs(v.x)+abs(v.z) > 0.5 then + self.object:set_animation_frame_speed((v2/math.max(1,self.run_velocity))*self.animation.walk_speed*self.frame_speed_multiplier) + else + self.object:set_animation_frame_speed(25) + end end --set_speed