Self-Generating Rogue Maze

Watch glowing architect orbs branch out from a central gold hub, carving stone corridors and stamping down color-coded dungeon rooms automatically.

Java EditionComplex Contraptions & CinematicsHard25 commandsTested on a real 26.2 & 26.3 server
Four glowing markers build a grid of stone-brick chambers around a central gold beacon on an obsidian platform. Download the GIF Video & GIF © www.9minecraft.net

Self-building StructuresMedievalDarkGoldBlackRainbowAdventure MapMini-gameMap MakingArmor standsSummoned mobsBlock building (fill/setblock/clone)Rotation math21+ commands

This command creation turns a blank obsidian platform into a self-building dungeon layout right before your eyes. Four glowing architect orbs branch out from a central gold beacon hub, carving open stone-brick corridors and stamping down color-coded chambers as they travel across the grid.

Every half-second, the builders step onto uncarved obsidian and construct new rooms: cyan chambers form standard dungeon rooms, crimson rooms sprout ominous soul lanterns, and gold rooms spawn treasure chests. When the maze completes, it resets and generates a fresh layout automatically.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9_t dummy
  2. /fill ~-16 ~-1 ~-16 ~16 ~-1 ~16 minecraft:obsidian
  3. /fill ~-16 ~ ~-16 ~16 ~3 ~16 minecraft:air
  4. /fill ~-2 ~-1 ~-2 ~2 ~-1 ~2 minecraft:gold_block
  5. /fill ~-2 ~ ~-2 ~2 ~1 ~2 minecraft:stone_brick_wall
  6. /fill ~-1 ~ ~-1 ~1 ~1 ~1 minecraft:air
  7. /setblock ~ ~ ~ minecraft:beacon
  8. /summon minecraft:armor_stand ~ ~ ~ {Tags:["c9_core","c9_ent"],NoGravity:1b,Invisible:1b}
  9. /summon minecraft:armor_stand ~ ~ ~ {Tags:["c9_b","c9_b1","c9_ent"],NoGravity:1b,Invisible:1b,Glowing:1b,Rotation:[0f,0f],equipment:{head:{id:"minecraft:sea_lantern",count:1}}}
  10. /summon minecraft:armor_stand ~ ~ ~ {Tags:["c9_b","c9_b2","c9_ent"],NoGravity:1b,Invisible:1b,Glowing:1b,Rotation:[90f,0f],equipment:{head:{id:"minecraft:shroomlight",count:1}}}

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

  1. /execute if entity @e[tag=c9_core,scores={c9_t=1}] run summon minecraft:armor_stand ~ ~ ~ {Tags:["c9_b","c9_b3","c9_ent"],NoGravity:1b,Invisible:1b,Glowing:1b,Rotation:[180f,0f],equipment:{head:{id:"minecraft:ochre_froglight",count:1}}}
  2. /execute if entity @e[tag=c9_core,scores={c9_t=1}] run summon minecraft:armor_stand ~ ~ ~ {Tags:["c9_b","c9_b4","c9_ent"],NoGravity:1b,Invisible:1b,Glowing:1b,Rotation:[270f,0f],equipment:{head:{id:"minecraft:verdant_froglight",count:1}}}
  3. /scoreboard players add @e[tag=c9_ent] c9_t 1
  4. /execute as @e[tag=c9_b] at @s run particle minecraft:end_rod ~ ~1.5 ~ 0.2 0.3 0.2 0.02 2 force
  5. /execute as @e[tag=c9_b] at @s if block ~ ~-1 ~ minecraft:obsidian run fill ~-2 ~ ~-2 ~2 ~1 ~2 minecraft:stone_bricks
  6. /execute as @e[tag=c9_b] at @s if block ~ ~-1 ~ minecraft:obsidian run fill ~-1 ~ ~-1 ~1 ~1 ~1 minecraft:air
  7. /execute as @e[tag=c9_b] at @s if block ~ ~-1 ~ minecraft:obsidian run fill ~-1 ~-1 ~-1 ~1 ~-1 ~1 minecraft:cyan_terracotta
  8. /execute as @e[tag=c9_b] at @s if block ~ ~-1 ~ minecraft:obsidian run particle minecraft:totem_of_undying ~ ~1 ~ 0.6 0.5 0.6 0.15 20 force
  9. /execute if entity @e[tag=c9_core,scores={c9_t=25}] as @e[tag=c9_b1] at @s run fill ~-1 ~-1 ~-1 ~1 ~-1 ~1 minecraft:gold_block
  10. /execute if entity @e[tag=c9_core,scores={c9_t=45}] as @e[tag=c9_b2] at @s run fill ~-1 ~-1 ~-1 ~1 ~-1 ~1 minecraft:crimson_nylium
  11. /execute if entity @e[tag=c9_core,scores={c9_t=65}] as @e[tag=c9_b3] at @s run fill ~-1 ~-1 ~-1 ~1 ~-1 ~1 minecraft:gold_block
  12. /execute as @e[tag=c9_b] at @s if block ~ ~-1 ~ minecraft:gold_block unless block ~ ~ ~ minecraft:beacon run setblock ~ ~ ~ minecraft:chest
  13. /execute as @e[tag=c9_b] at @s if block ~ ~-1 ~ minecraft:crimson_nylium run setblock ~ ~ ~ minecraft:soul_lantern
  14. /execute as @e[tag=c9_b,scores={c9_t=10..}] at @s store success score @s c9_t if block ^ ^-1 ^4 minecraft:obsidian run tp @s ^ ^ ^4 ~90 ~
  15. /execute as @e[tag=c9_b,scores={c9_t=10..}] at @s run tp @s ~ ~ ~ ~90 ~

How it works

Frames from the test run

Self-Generating Rogue Maze - frame 1Self-Generating Rogue Maze - frame 2Self-Generating Rogue Maze - frame 3

Recorded on our own test server: 58 frames at about 9.6 fps. Our image check saw: A generated grid of stone-brick chambers with color-coded rooms and chests sits on an obsidian base around a central gold beacon, with four glowing builder entities positioned across the layout.

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. Stand at the center of a flat open area and run the 10 setup commands in chat one by one.
  2. You will see a 33x33 obsidian floor with a central gold beacon hub and glowing architect blocks at the center.
  3. Place 15 repeating command blocks (set to Always Active) near the platform.
  4. Paste each of the 15 loop commands into its own repeating command block.
  5. Watch the four glowing architect orbs step outward every half-second, stamping down stone walls and cyan, crimson, and gold dungeon rooms.
  6. To generate a brand new layout after the builders finish, run the cleanup commands and repeat the setup.

Use it with real players

To let a player trigger dungeon generation on demand with a custom item, replace the c9_core timer condition with a check for a player holding a named blaze rod (@a[nbt={SelectedItem:{id:"minecraft:blaze_rod"}}]), and summon the four c9_b architect orbs directly at the player's position aligned to the 4-block grid.

Remove it again 4 commands

  1. /kill @e[tag=c9_ent]
  2. /scoreboard objectives remove c9_t
  3. /fill ~-16 ~-1 ~-16 ~16 ~-1 ~16 minecraft:grass_block
  4. /fill ~-16 ~ ~-16 ~16 ~4 ~16 minecraft:air

FAQ

Why do the architect orbs never leave the obsidian platform?

Before stepping 4 blocks forward, each orb checks if the floor block at ^ ^-1 ^4 is obsidian. Because the area outside the 33x33 canvas is grass, they automatically turn 90 degrees back inward.

How can I change the room types or colors?

Edit the fill commands in the loop that place cyan_terracotta, gold_block, and crimson_nylium to any block palette you prefer, just keep obsidian reserved for the uncarved floor.

Commands used

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

Similar creations

Join 9Minecraft News & Guides