1
0
Fork 0
MineClone2/mods/ENTITIES/mcl_mobs/api/env/fall_damage.lua

9 lines
281 B
Lua

function mcl_mobs.mob:fall_damage_step()
-- ToDo: fall damage based on distance, not velocity
local velocity = self.object:get_velocity()
if self.last_velocity.y < -7 and velocity.y == 0 then
self:deal_damage(math.abs(self.last_velocity.y + 7) * 2, {type = "fall"})
end
end