diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 460a1cb8f..90ac35004 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -372,7 +372,9 @@ mcl_potions.register_effect({ playerphysics.add_physics_factor(object, "gravity", "mcl_potions:slow_falling", 0.5) end, on_step = function(dtime, object, factor, duration) - local vel = object:get_velocity().y + local vel = object:get_velocity() + if not vel then return end + vel = vel.y if vel < -3 then object:add_velocity(vector.new(0,-3-vel,0)) end end, on_end = function(object) @@ -430,7 +432,9 @@ mcl_potions.register_effect({ return S("moves body upwards at @1 nodes/s", factor) end, on_step = function(dtime, object, factor, duration) - local vel = object:get_velocity().y + local vel = object:get_velocity() + if not vel then return end + vel = vel.y if vel