From cd5afc920a53608906064f9c7a44a279b90cb8ce Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Fri, 29 Sep 2023 15:31:04 +0100 Subject: [PATCH] add nil check to sheepy --- sheep.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sheep.lua b/sheep.lua index ef13239..a38d9d6 100644 --- a/sheep.lua +++ b/sheep.lua @@ -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