1
0
mirror of https://codeberg.org/tenplus1/mobs_animal.git synced 2024-11-12 22:00:19 +01:00

check item exists for hairballs

This commit is contained in:
tenplus1 2021-04-02 14:01:14 +01:00
parent f2b1b752a7
commit 54f6de148b

View File

@ -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