mirror of
https://codeberg.org/tenplus1/mobs_animal.git
synced 2024-11-12 22:00:19 +01:00
add nil check to sheepy
This commit is contained in:
parent
e644a1b523
commit
cd5afc920a
|
@ -444,7 +444,10 @@ if not mobs.custom_spawn_animal then
|
|||
local entity = mobs:add_mob(pos,
|
||||
{name = "mobs_animal:sheep_" .. types, child = lamb})
|
||||
|
||||
if entity and not lamb then
|
||||
-- nil check
|
||||
if not entity then return end
|
||||
|
||||
if not lamb then
|
||||
-- Set horns attribute, lower height will be rarer.
|
||||
-- This wont affect mobs spawned by egg those only spawn hornless sheep.
|
||||
local horns = random(max_ht) <= pos.y
|
||||
|
|
Loading…
Reference in New Issue
Block a user