Page 1 of 1

Add spawner to Dungeons

PostPosted: Mon Apr 11, 2016 12:10
by burli
I want to add spawner to dungeons. How can I get the dungeon type (mossy cobble, desert sandstone...) and place a spawner into a room?

Re: Add spawner to Dungeons

PostPosted: Mon Apr 11, 2016 14:52
by cd2
Something like this should work (replace function name with the function that places a spawner):

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.set_gen_notify("dungeon")

minetest.register_on_generated(function(minp, maxp, blockseed)
   local g = minetest.get_mapgen_object("gennotify")
   if g and g.dungeon and #g.dungeon > 2 then
      minetest.after(3, <function name>, table.copy(g.dungeon))
   end
end)


I would use minetest.get_node to check the dungeon type

Re: Add spawner to Dungeons

PostPosted: Tue Apr 12, 2016 02:05
by BrandonReese
Dungeons are mossy cobble, temples are dessert stone

minetest.set_gen_notify("dungeon","temple")

Re: Add spawner to Dungeons

PostPosted: Wed May 18, 2016 09:27
by xeranas
Try spawners mod (auto-spawning needs to be enabled through mod settings.txt).