nodes.lua 1.12 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34


--wasps nest

minetest.register_node("dmobs:hive", {
	description = "Wasp Nest",
	tiles = {"dmobs_hive.png"},
	groups = {crumbly=1, oddly_breakable_by_hand=1, falling_node=1, flammable=1},
	on_destruct = function(pos, oldnode)
		minetest.env:add_entity(pos, "dmobs:wasp")
		minetest.env:add_entity(pos, "dmobs:wasp")
		minetest.env:add_entity(pos, "dmobs:wasp")
		minetest.env:add_entity(pos, "dmobs:wasp")
	end,
})

--golem

minetest.register_node("dmobs:golemstone", {
	description = "golem stone",
	tiles = {"dmobs_golem_stone.png",},
	groups = {cracky=1},
	on_construct = function(pos, node, _)
		local node1 = minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}).name
		local node2 = minetest.env:get_node({x=pos.x, y=pos.y-2, z=pos.z}).name
		local node3 = minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name
		if node1 == "default:stone" and node2 == "default:stone" and node3 == "air" then
		minetest.env:add_entity(pos, "dmobs:golem_friendly")
		minetest.env:remove_node({x=pos.x, y=pos.y-1, z=pos.z})
		minetest.env:remove_node({x=pos.x, y=pos.y-2, z=pos.z})
		minetest.env:remove_node({x=pos.x, y=pos.y, z=pos.z})
		end
	end,
})