forked from mtcontrib/mobs_animal
		
	check item exists for hairballs
This commit is contained in:
		| @@ -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 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)] | 		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}) | 			minetest.add_item(newpos, {name = item}) | ||||||
| 		end | 		end | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user