diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 8b86e4b983..0f5f59ae89 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -276,8 +276,11 @@ end local get_velocity = function(self) local v = self.object:get_velocity() + if v then + return (v.x * v.x + v.z * v.z) ^ 0.5 + end - return (v.x * v.x + v.z * v.z) ^ 0.5 + return 0 end