![](http://smnfrd.it/wp-content/uploads/2016/04/b2a81be23c2be290a7d4ff5d8dc94278.png)
/scoreboard objectives add dungeon dummy
Adds a score called dungeon
![](http://smnfrd.it/wp-content/uploads/2016/04/repeating_u-1.png)
/execute @a[score_dungeon_min=20000] ~ ~ ~ execute @r[type=Bat] ~ ~ ~ clone x y z x y z ~ ~-1 ~
Executes a player with the score setted at 20000 (change the number to change the frequency of dungeon's spawning) the action to execute a bat the action to clone the structure block.
If you want to spawn a structure on the surface, just use a surface mob instead of a bat (for example a Pig, ...)
![](http://smnfrd.it/wp-content/uploads/2016/04/7d30f30530bc447755f42a466ff3efea.png)
/execute @e[type=Bat] ~ ~ ~ detect ~ ~-1 ~ minecraft:structure_block 1 setblock ~ ~-1 ~1 redstone_block
When the block is cloned, all the bats detect a structure block, and if they find it, they place a redstone block, to power the structure block
![](http://smnfrd.it/wp-content/uploads/2016/04/7d30f30530bc447755f42a466ff3efea.png)
/execute @e[type=Bat] ~ ~ ~ detect ~ ~-1 ~ minecraft:structure_block 1 fill ~ ~-1 ~1 ~ ~-1 ~ air
When the redstone block is placed, all the bats detect a structure block, and if they find it, they remove the two blocks
![](http://smnfrd.it/wp-content/uploads/2016/04/7d30f30530bc447755f42a466ff3efea.png)
/tp @e[type=Bat] ~ 0 ~
Teleports all the bats at bedrock level, so they die. This is used to be sure you don't find two dungeons too near.
![](http://smnfrd.it/wp-content/uploads/2016/04/b31adf9a605bee69991378071483c48c.png)
/scoreboard players add @a dungeon 1
Adds one to the score of each player
![](http://smnfrd.it/wp-content/uploads/2016/04/b31adf9a605bee69991378071483c48c.png)
/scoreboard players set @a[score_dungeon_min=20001] dungeon 0
Resets the score of all the players with the score of 20001 or more
Recent Comments