diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua index d144c9bc8..3fcc15fe5 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua @@ -1101,6 +1101,12 @@ mobs.mob_step = function(self, dtime) end end + --do not continue if non-existent + if not self or not self.object or not self.object:get_luaentity() then + self.object:remove() + return false + end + -- can mob be pushed, if so calculate direction -- do this last (overrides everything) if self.pushable then diff --git a/mods/ENTITIES/mobs_mc/sheep.lua b/mods/ENTITIES/mobs_mc/sheep.lua index 3878a2558..5be276d8f 100644 --- a/mods/ENTITIES/mobs_mc/sheep.lua +++ b/mods/ENTITIES/mobs_mc/sheep.lua @@ -378,3 +378,4 @@ mobs_mc.spawn_height.overworld_max) -- spawn eggs mobs:register_egg("mobs_mc:sheep", S("Sheep"), "mobs_mc_spawn_icon_sheep.png", 0) +