0
0
Fork 0

Fix passive mobs despawning

According to the wiki most passive mobs do not despawn. The ones that do
have already been explicity marked as despawning.

<https://minecraft.fandom.com/wiki/Spawn#Despawning>
<https://minecraft.fandom.com/wiki/Mob#Despawning>
This commit is contained in:
Saku Laesvuori 2021-04-03 20:12:24 +03:00
parent ac87e0604e
commit 4a085c9526
1 changed files with 2 additions and 0 deletions

View File

@ -3741,6 +3741,8 @@ function mobs:register_mob(name, def)
local can_despawn local can_despawn
if def.can_despawn ~= nil then if def.can_despawn ~= nil then
can_despawn = def.can_despawn can_despawn = def.can_despawn
elseif def.spawn_class == "passive" then
can_despawn = false
else else
can_despawn = true can_despawn = true
end end