Automated Dungeon Builder

Watch a glowing blueprint orb carve out a random dungeon of deepslate rooms, connecting hallways, soul lanterns, and lava traps right before your eyes.

Java EditionComplex Contraptions & CinematicsHard26 commandsTested on a real 26.2 & 26.3 server
Glowing armor stands automatically generate interconnected stone brick dungeon chambers with lava hazards. Download the GIF Video & GIF © www.9minecraft.net

Self-building StructuresMedievalDarkFireBlackOrangeCyanBuilding ToolAdventure MapMap MakingArmor standsBlock building (fill/setblock/clone)Sounds21+ commands

The Automated Dungeon Builder uses a pair of pathfinding drones to construct a complete underground-style dungeon layout on a flat surface in seconds. Starting from a central vault room, glowing architect orbs race outward across a 6-block grid, carving out chambers, punching archways through walls, and installing traps.

Each generated room has a chance to spawn either a bubbling lava hazard or a loot pedestal with soul lantern lighting. Once the maze reaches full capacity, the system resets and builds a brand-new random layout.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9_t dummy
  2. /scoreboard objectives add c9_rng dummy
  3. /scoreboard objectives add c9_rooms dummy
  4. /fill ~-16 ~-1 ~-16 ~16 ~-1 ~16 polished_deepslate
  5. /fill ~-3 ~ ~-3 ~3 ~3 ~3 deepslate_bricks hollow
  6. /fill ~-2 ~-1 ~-2 ~2 ~-1 ~2 chiseled_deepslate
  7. /setblock ~ ~ ~ chest
  8. /setblock ~ ~3 ~ glowstone
  9. /summon armor_stand ~ ~0.5 ~ {Tags:["c9_gen","c9_g1"],NoGravity:1b,Invisible:1b,Glowing:1b,ArmorItems:[{},{},{},{id:"minecraft:conduit",count:1}]}
  10. /summon armor_stand ~ ~0.5 ~ {Tags:["c9_gen","c9_g2"],NoGravity:1b,Invisible:1b,Glowing:1b,ArmorItems:[{},{},{},{id:"minecraft:sea_lantern",count:1}]}

2. Loop - one repeating command block each (Always Active) 16 commands

  1. /scoreboard players add #tick c9_t 1
  2. /execute as @e[tag=c9_gen] at @s run particle soul_fire_flame ~ ~0.5 ~ 0.2 0.2 0.2 0.02 3 force
  3. /execute as @e[tag=c9_gen] at @s run particle dust{color:[0.2,0.9,1.0],scale:1.5} ~ ~0.5 ~ 0.3 0.3 0.3 0 4 force
  4. /execute if score #tick c9_t matches 15.. as @e[tag=c9_gen] at @s store result score @s c9_rng run random value 0..3
  5. /execute if score #tick c9_t matches 15.. as @e[tag=c9_gen,scores={c9_rng=0}] at @s run tp @s ~6 ~ ~
  6. /execute if score #tick c9_t matches 15.. as @e[tag=c9_gen,scores={c9_rng=1}] at @s run tp @s ~-6 ~ ~
  7. /execute if score #tick c9_t matches 15.. as @e[tag=c9_gen,scores={c9_rng=2}] at @s run tp @s ~ ~ ~6
  8. /execute if score #tick c9_t matches 15.. as @e[tag=c9_gen,scores={c9_rng=3}] at @s run tp @s ~ ~ ~-6
  9. /execute if score #tick c9_t matches 15.. as @e[tag=c9_gen] at @s unless block ~ ~-1 ~ polished_deepslate run tp @s ~ ~0.5 ~
  10. /execute if score #tick c9_t matches 15.. as @e[tag=c9_gen] at @s if block ~ ~3 ~ air run fill ~-3 ~ ~-3 ~3 ~3 ~3 deepslate_bricks hollow
  11. /execute if score #tick c9_t matches 15.. as @e[tag=c9_gen] at @s if block ~ ~2 ~ air run playsound block.deepslate_bricks.place block @a ~ ~ ~ 1 0.8
  12. /execute if score #tick c9_t matches 15.. as @e[tag=c9_gen] at @s run fill ~-1 ~ ~-3 ~1 ~2 ~3 air
  13. /execute if score #tick c9_t matches 15.. as @e[tag=c9_gen] at @s run fill ~-3 ~ ~-1 ~3 ~2 ~1 air
  14. /execute if score #tick c9_t matches 15.. as @e[tag=c9_gen] at @s if score @s c9_rng matches 0..1 run setblock ~ ~-1 ~ lava
  15. /execute if score #tick c9_t matches 15.. as @e[tag=c9_gen] at @s if score @s c9_rng matches 2..3 run setblock ~ ~2 ~ soul_lantern[hanging=true]
  16. /execute if score #tick c9_t matches 15.. run scoreboard players set #tick c9_t 0

How it works

Frames from the test run

Automated Dungeon Builder - frame 1Automated Dungeon Builder - frame 2Automated Dungeon Builder - frame 3

Recorded on our own test server: 58 frames at about 9.6 fps. Our image check saw: Glowing armor stands move across a flat stone platform, automatically generating interconnected stone brick dungeon rooms with archways and interior lava hazards.

Commands, video and screenshots: tested and recorded by www.9minecraft.net © 9Minecraft. Sharing a video or screenshot? Please credit www.9minecraft.net.

Build it in your world

  1. Find a flat area with at least 35x35 blocks of clear space and stand in the center.
  2. Run each of the 10 setup commands in chat to create the scoreboards, lay down the deepslate foundation, build the central starting chamber, and summon the two builder drones.
  3. Place a column or line of 16 Command Blocks near your build area (outside the 33x33 deepslate floor).
  4. Set the first command block to Repeat, Unconditional, Always Active, and set the remaining 15 chained to it as Chain, Unconditional, Always Active.
  5. Paste the 16 loop commands in order into the command blocks. If your command blocks are away from the center, wrap the boundary check command (loop #9) with your center coordinates.
  6. Watch the two glowing builder orbs hop across the grid, assembling interconnected dungeon rooms and traps automatically.

Use it with real players

To let a player trigger dungeon expansion manually with a wand instead of running on a timer, remove loop commands 1 and 16, and replace if score #tick c9_t matches 15.. with a check for a player holding a specific item or right-clicking a carrot on a stick. You can also increase the foundation size in setup command 4 to generate massive playable labyrinths.

Remove it again 6 commands

  1. /kill @e[tag=c9_gen]
  2. /fill ~-16 ~ ~-16 ~16 ~5 ~16 air
  3. /fill ~-16 ~-1 ~-16 ~16 ~-1 ~16 grass_block
  4. /scoreboard objectives remove c9_t
  5. /scoreboard objectives remove c9_rng
  6. /scoreboard objectives remove c9_rooms

FAQ

Can I change the size of the rooms?

Yes! The rooms are built on a 6-block grid so that 7x7 rooms share 1-block-thick walls. If you want 9x9 rooms, change the teleport distances from 6 to 8 and expand the hollow fill command to ~-4 ~ ~-4 ~4 ~4 ~4.

Why do the builder orbs teleport back to the center sometimes?

Loop command 9 checks if there is a polished deepslate floor beneath the orb. When an orb steps outside the 33x33 arena, it resets back to the starting room so it never builds outside the stage.

Commands used

/execute/fill/particle/playsound/random/scoreboard/setblock/summon/tp

Similar creations

Join 9Minecraft News & Guides