From 54f6de148b218a5d652260e3feb9a61fdd153b69 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Fri, 2 Apr 2021 14:01:14 +0100 Subject: [PATCH] check item exists for hairballs --- kitten.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kitten.lua b/kitten.lua index 04aa6f0..5809451 100644 --- a/kitten.lua +++ b/kitten.lua @@ -155,7 +155,8 @@ minetest.register_craftitem(":mobs:hairball", { local newpos = {x = pos.x + dir.x, y = pos.y + dir.y + 1.5, z = pos.z + dir.z} local item = hairball_items[math.random(1, #hairball_items)] - if item ~= "" then + if item ~= "" + and minetest.registered_items[item] then minetest.add_item(newpos, {name = item}) end