loot/dungeon.lua
2019-06-07 12:37:15 -05:00

20 lines
413 B
Lua

minetest.set_gen_notify("dungeon")
minetest.register_on_generated(function(minp, maxp, blockseed)
local notif = minetest.get_mapgen_object("gennotify")
if not notif then return end
local locations = notif.dungeon
if not locations then return end
for i, location in ipairs(locations) do
if math.random(3) == 1 then
minetest.add_node(location, { name = "loot:loot_node" })
end
end
end)