Watch four glowing builder drones automatically generate a stone brick dungeon maze on a four-block grid using pure vanilla Minecraft commands.
Self-building StructuresMedievalTechnologyCyanGoldBlackBuilding ToolMini-gameAdventure MapBlock displaysSmooth animation (interpolation)Summoned mobsBlock building (fill/setblock/clone)21+ commands
Watch an intricate dungeon labyrinth construct itself before your eyes. Starting from a central golden core, four glowing cyan drones branch outward across a polished deepslate arena, building walls and carving out rooms and corridors on a four-block grid.
Each builder drone checks adjacent cells using block detection, building new stone brick enclosures into unvisited territory and backtracking through finished halls when it hits a dead end.
/scoreboard objectives add c9_t dummy/scoreboard players set #tick c9_t 0/fill ~-16 ~-1 ~-16 ~16 ~-1 ~16 minecraft:polished_deepslate/fill ~-16 ~ ~-16 ~16 ~5 ~16 minecraft:air/fill ~-2 ~ ~-2 ~2 ~2 ~2 minecraft:stone_bricks hollow/fill ~-1 ~-1 ~-1 ~1 ~-1 ~1 minecraft:gold_block/summon minecraft:block_display ~ ~2 ~ {Tags:["c9_b"],Glowing:1b,glow_color_override:65535,teleport_duration:3,block_state:{Name:"minecraft:sea_lantern"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.9f,0.9f,0.9f],translation:[-0.45f,-0.45f,-0.45f]}}/summon minecraft:block_display ~ ~2 ~ {Tags:["c9_b"],Glowing:1b,glow_color_override:16753920,teleport_duration:3,block_state:{Name:"minecraft:shroomlight"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.8f,0.8f,0.8f],translation:[-0.4f,-0.4f,-0.4f]}}/summon minecraft:block_display ~ ~2 ~ {Tags:["c9_b"],Glowing:1b,glow_color_override:65535,teleport_duration:3,block_state:{Name:"minecraft:beacon"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.8f,0.8f,0.8f],translation:[-0.4f,-0.4f,-0.4f]}}/summon minecraft:block_display ~ ~2 ~ {Tags:["c9_b"],Glowing:1b,glow_color_override:16753920,teleport_duration:3,block_state:{Name:"minecraft:ochre_froglight"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.8f,0.8f,0.8f],translation:[-0.4f,-0.4f,-0.4f]}}/scoreboard players add #tick c9_t 1/execute as @e[tag=c9_b] at @s run particle minecraft:dust{color:[0.1,0.95,1.0],scale:1.6} ~ ~0.4 ~ 0.3 0.3 0.3 0 4 force/execute if score #tick c9_t matches 3.. as @e[tag=c9_b] store result score @s c9_t run random value 0..3/execute if score #tick c9_t matches 3.. as @e[tag=c9_b,scores={c9_t=0}] at @s if block ~4 ~-3 ~ minecraft:polished_deepslate run fill ~1 ~-2 ~-1 ~3 ~ ~1 minecraft:air/execute if score #tick c9_t matches 3.. as @e[tag=c9_b,scores={c9_t=0}] at @s unless block ~4 ~-3 ~ minecraft:grass_block if block ~4 ~-3 ~ minecraft:polished_deepslate run tp @s ~4 ~ ~/execute if score #tick c9_t matches 3.. as @e[tag=c9_b,scores={c9_t=1}] at @s if block ~-4 ~-3 ~ minecraft:polished_deepslate run fill ~-3 ~-2 ~-1 ~-1 ~ ~1 minecraft:air/execute if score #tick c9_t matches 3.. as @e[tag=c9_b,scores={c9_t=1}] at @s unless block ~-4 ~-3 ~ minecraft:grass_block if block ~-4 ~-3 ~ minecraft:polished_deepslate run tp @s ~-4 ~ ~/execute if score #tick c9_t matches 3.. as @e[tag=c9_b,scores={c9_t=2}] at @s if block ~ ~-3 ~4 minecraft:polished_deepslate run fill ~-1 ~-2 ~1 ~1 ~ ~3 minecraft:air/execute if score #tick c9_t matches 3.. as @e[tag=c9_b,scores={c9_t=2}] at @s unless block ~ ~-3 ~4 minecraft:grass_block if block ~ ~-3 ~4 minecraft:polished_deepslate run tp @s ~ ~ ~4/execute if score #tick c9_t matches 3.. as @e[tag=c9_b,scores={c9_t=3}] at @s if block ~ ~-3 ~-4 minecraft:polished_deepslate run fill ~-1 ~-2 ~-3 ~1 ~ ~-1 minecraft:air/execute if score #tick c9_t matches 3.. as @e[tag=c9_b,scores={c9_t=3}] at @s unless block ~ ~-3 ~-4 minecraft:grass_block if block ~ ~-3 ~-4 minecraft:polished_deepslate run tp @s ~ ~ ~-4/execute if score #tick c9_t matches 3.. as @e[tag=c9_b] at @s if block ~ ~-3 ~ minecraft:polished_deepslate run fill ~-2 ~-2 ~-2 ~2 ~ ~2 minecraft:stone_bricks replace minecraft:air/execute if score #tick c9_t matches 3.. as @e[tag=c9_b] at @s if block ~ ~-3 ~ minecraft:polished_deepslate run fill ~-1 ~-3 ~-1 ~1 ~-1 ~1 minecraft:deepslate_tiles/execute if score #tick c9_t matches 3.. as @e[tag=c9_b] at @s if block ~ ~-3 ~ minecraft:deepslate_tiles if block ~2 ~-2 ~ minecraft:air if score @s c9_t matches 0 run tp @s ~4 ~ ~setup #3 Fills a 33x33 floor with <code>polished_deepslate</code>, which acts as the unvisited cell state for the maze generator.setup #7 Summons glowing <code>block_display</code> drones at the center with <code>teleport_duration:3</code> so their 4-block jumps interpolate smoothly.loop #3 Every 3 ticks, uses <code>/random value 0..3</code> to assign each builder drone a random cardinal direction (East, West, South, or North).loop #4 Checks if the neighboring cell 4 blocks away still has a <code>polished_deepslate</code> floor. If so, it carves an air doorway through the wall before moving in.loop #12 When a drone arrives at a fresh cell, it builds a 5x3x5 <code>stone_bricks</code> room around itself without overwriting the doorway it just carved, then stamps the floor with <code>deepslate_tiles</code> to mark the cell as visited.


Recorded on our own test server: 70 frames at about 9.9 fps. Our image check saw: An aerial view of a large stone brick labyrinth with a golden center being built on a deepslate grid by glowing cyan marker entities.
Commands, video and screenshots: tested and recorded by www.9minecraft.net © 9Minecraft. Sharing a video or screenshot? Please credit www.9minecraft.net.
To let a player guide or spawn new maze branches manually, give yourself a spawn item or run /execute at @p align xyz run summon minecraft:block_display ~0.5 ~2 ~0.5 {Tags:["c9_b"],Glowing:1b,teleport_duration:3,block_state:{Name:"minecraft:sea_lantern"}} while standing on the center of any unvisited 4-block grid cell.
/kill @e[tag=c9_b]/scoreboard objectives remove c9_t/fill ~-16 ~ ~-16 ~16 ~5 ~16 minecraft:air/fill ~-16 ~-1 ~-16 ~16 ~-1 ~16 minecraft:grass_blockUnvisited cells have a Polished Deepslate floor. When a drone enters a cell, it replaces the 3x3 center floor with Deepslate Tiles, so future checks see that the cell is already visited.
Yes! Increase the size of the initial Polished Deepslate floor fill command in the setup using any multiple of 4 (such as ~-24 to ~24), and the drones will automatically expand to the edges of the floor.
▶Automated Spire ConstructorSelf-building StructuresMedium19 cmds
▶Colossal Algorithmic Maze BuilderSelf-building StructuresHard22 cmds
▶Da Vinci Flying Machine AssemblySelf-building StructuresHard24 cmds
▶Procedural Dungeon GeneratorSelf-building StructuresExpert24 cmds
▶Autonomous Dungeon ArchitectSelf-building StructuresExpert24 cmds
▶Autonomous Room-Stitching EngineSelf-building StructuresHard24 cmds