Watch a 23x23 stone labyrinth build itself in real time as glowing spectral mason orbs snake across a tiled courtyard, carving paths and raising stone walls.
Self-building StructuresMedievalMysticNatureGreenCyanWhiteMini-gameAdventure MapBuilding ToolItem displaysSmooth animation (interpolation)Summoned mobsBlock building (fill/setblock/clone)Rotation math21+ commands
This command creation uses the classic Depth-First Search (DFS) recursive backtracking algorithm to build a genuine 23x23 stone labyrinth right before your eyes. Glowing spectral mason orbs snake across a tiled stone courtyard, carving open pathways and raising three-block-tall walls of stone brick, mossy stone brick, and sea lanterns.
Because each mason orb chooses random unvisited directions every single tick and backtracks along its breadcrumb trail when cornered, every labyrinth generated is completely unique and solvable.
/scoreboard objectives add c9_t dummy/fill ~-12 ~-1 ~-12 ~12 ~-1 ~12 minecraft:chiseled_stone_bricks/fill ~-11 ~-1 ~-11 ~11 ~-1 ~11 minecraft:polished_andesite/fill ~-11 ~ ~-11 ~11 ~2 ~11 minecraft:stone_bricks/fill ~-11 ~2 ~-11 ~11 ~2 ~11 minecraft:mossy_stone_bricks replace minecraft:stone_bricks/setblock ~ ~-1 ~ minecraft:sea_lantern/fill ~ ~ ~ ~ ~2 ~ minecraft:air/summon minecraft:item_display ~0.5 ~3.2 ~0.5 {Tags:["c9_ent","c9_head"],Glowing:1b,glow_color_override:65535,teleport_duration:1,item:{id:"minecraft:conduit"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[1.6f,1.6f,1.6f]}}/summon minecraft:item_display ~-9.5 ~3.2 ~-9.5 {Tags:["c9_ent","c9_head"],Glowing:1b,glow_color_override:16755200,teleport_duration:1,item:{id:"minecraft:shroomlight"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[1.5f,1.5f,1.5f]}}/summon minecraft:item_display ~9.5 ~3.2 ~9.5 {Tags:["c9_ent","c9_head"],Glowing:1b,glow_color_override:16711935,teleport_duration:1,item:{id:"minecraft:sea_lantern"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[1.5f,1.5f,1.5f]}}/execute as @e[tag=c9_head] at @s run tag @s remove c9_step/execute as @e[tag=c9_head] at @s if block ~ ~-4.2 ~-2 minecraft:polished_andesite run summon minecraft:marker ~ ~ ~-2 {Tags:["c9_ent","c9_opt"],Rotation:[180f,0f]}/execute as @e[tag=c9_head] at @s if block ~ ~-4.2 ~2 minecraft:polished_andesite run summon minecraft:marker ~ ~ ~2 {Tags:["c9_ent","c9_opt"],Rotation:[0f,0f]}/execute as @e[tag=c9_head] at @s if block ~2 ~-4.2 ~ minecraft:polished_andesite run summon minecraft:marker ~2 ~ ~ {Tags:["c9_ent","c9_opt"],Rotation:[-90f,0f]}/execute as @e[tag=c9_head] at @s if block ~-2 ~-4.2 ~ minecraft:polished_andesite run summon minecraft:marker ~-2 ~ ~ {Tags:["c9_ent","c9_opt"],Rotation:[90f,0f]}/execute as @e[tag=c9_head] at @s as @e[tag=c9_opt,distance=..2.5,sort=random,limit=1] at @s run tag @s add c9_pick/execute as @e[tag=c9_pick] at @s run fill ^ ^-3.2 ^ ^ ^-1.2 ^-1 minecraft:air/execute as @e[tag=c9_pick] at @s run fill ^ ^-4.2 ^ ^ ^-4.2 ^-1 minecraft:smooth_quartz/execute as @e[tag=c9_pick] at @s positioned ^ ^ ^-1 run summon minecraft:marker ~ ~ ~ {Tags:["c9_ent","c9_crumb"]}/execute as @e[tag=c9_head] at @s if entity @e[tag=c9_pick,distance=..2.5] run tag @s add c9_step/execute as @e[tag=c9_head,tag=c9_step] at @s run tp @s @e[tag=c9_pick,distance=..2.5,limit=1]/execute as @e[tag=c9_head,tag=!c9_step] at @s as @e[tag=c9_crumb,distance=..1.5,limit=1] at @s run fill ^ ^-4.2 ^ ^ ^-4.2 ^1 minecraft:sea_lantern/execute as @e[tag=c9_head,tag=!c9_step] at @s as @e[tag=c9_crumb,distance=..1.5,limit=1] at @s positioned ^ ^ ^-1 run tp @e[tag=c9_head,distance=..2.5,limit=1] ~ ~ ~/kill @e[tag=c9_opt]setup #4 Fills the 23x23 arena above the polished andesite grid with solid stone bricks and a mossy stone brick top layer, ready to be carved into labyrinth corridors.setup #8 Summons the main cyan glowing conduit mason orb at the centre of the labyrinth, plus two corner mason orbs so corridors converge across the whole platform.loop #2 Checks 2 blocks North, South, East, and West of each mason orb for unvisited polished andesite floor tiles and places temporary candidate markers with matching cardinal yaw rotations.loop #6 Selects one candidate direction at random using <code>sort=random,limit=1</code> and tags it with <code>c9_pick</code>.loop #7 Uses local coordinates (<code>^ ^ ^-1</code>) on the chosen marker to carve a 2-block-long air corridor through the stone brick wall and lay down a smooth quartz floor path.loop #13 When an orb reaches a dead end with no unvisited neighbors, it follows its <code>c9_crumb</code> markers backward and inlays glowing sea lanterns along completed branches.


Recorded on our own test server: 53 frames at about 8.8 fps. Our image check saw: A stone brick and mossy stone brick maze with sea lanterns and glowing spectral blocks is shown from above, though all three frames are identical.
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 manually reset and watch a fresh labyrinth generate around them, place the setup commands inside a chain triggered by a stone button at the entrance, or summon a single c9_head orb at @p aligned to odd coordinates so the maze branches outward from where you stand.
/kill @e[tag=c9_ent]/fill ~-12 ~ ~-12 ~12 ~4 ~12 minecraft:air/fill ~-12 ~-1 ~-12 ~12 ~-1 ~12 minecraft:grass_block/scoreboard objectives remove c9_tYes. Because the mason orbs pick directions using sort=random every tick, the corridor layout is completely different on every run.
Stepping by two blocks ensures a one-block-thick stone brick wall always remains between adjacent corridors so rooms never merge into wide open halls.
▶Mythic World-Tree Yggdrasil BloomingSelf-building StructuresExpert20 cmds
▶Automated Spire ConstructorSelf-building StructuresMedium19 cmds
▶Autonomous Cave BorrowerSelf-building StructuresHard24 cmds
▶Bonsai Cherry Blossom Time-Lapse SculptingSelf-building StructuresHard24 cmds
▶Colossal Algorithmic Maze BuilderSelf-building StructuresHard22 cmds
▶Floating Island TerraformerSelf-building StructuresHard24 cmds