Modular deepslate corridors and glowing sea lantern nodes snap together and reconfigure themselves in real time to build a shifting maze.
Self-building StructuresDarkMysticMedievalCyanBluePurpleAdventure MapMini-gameMap MakingBlock displaysArmor standsSummoned mobsBlock building (fill/setblock/clone)Rotation math21+ commands
The Self-Assembling Labyrinth turns an empty platform into a living, shifting dungeon. A glowing central nexus sends out builder drones across a 31x31 grid, raising polished deepslate pillars, sea lantern beacons, and modular stone brick walls that rise out of the floor accompanied by soul flames and portal sparks.
By combining randomized entity selection with grid-snapped coordinates, the maze never builds the same layout twice. Sections of the labyrinth periodically collapse and rebuild in new directions, creating an endless self-constructing puzzle with zero data packs required.
/scoreboard objectives add c9_tick dummy/fill ~-15 ~-1 ~-15 ~15 ~-1 ~15 minecraft:polished_deepslate/fill ~-16 ~ ~-16 ~16 ~3 ~16 minecraft:deepslate_bricks outline/fill ~-15 ~ ~-15 ~15 ~3 ~15 minecraft:air/fill ~-1 ~ ~-1 ~1 ~3 ~1 minecraft:chiseled_deepslate/setblock ~ ~4 ~ minecraft:sea_lantern/summon minecraft:block_display ~-0.5 ~4.5 ~-0.5 {Tags:["c9_lab","c9_core"],Glowing:1b,glow_color_override:65535,block_state:{Name:"minecraft:beacon"}}/summon minecraft:armor_stand ~ ~ ~ {Tags:["c9_lab","c9_spawner"],Invisible:1b,NoGravity:1b,Marker:1b}/scoreboard players add #c9_clock c9_tick 1/execute if score #c9_clock c9_tick matches 1..25 as @e[tag=c9_spawner] at @s run summon minecraft:armor_stand ~ ~ ~ {Tags:["c9_lab","c9_walker","c9_init"],Invisible:1b,NoGravity:1b,Marker:1b}/execute as @e[tag=c9_init,limit=1] at @s run spreadplayers ~ ~ 3 12 false @s/execute as @e[tag=c9_init] at @s align xz positioned ~0.5 ~ ~0.5 run tp @s ~ ~ ~/tag @e[tag=c9_init] remove c9_init/execute if score #c9_clock c9_tick matches 30.. run scoreboard players set #c9_clock c9_tick 26/scoreboard players add #c9_step c9_tick 1/execute if score #c9_step c9_tick matches 4.. run scoreboard players set #c9_step c9_tick 0/execute if score #c9_step c9_tick matches 1 as @e[tag=c9_walker,limit=6,sort=random] at @s run fill ~-1 ~ ~-1 ~1 ~2 ~1 minecraft:air replace minecraft:stone_bricks/execute if score #c9_step c9_tick matches 1 as @e[tag=c9_walker,limit=4,sort=random] at @s if block ~ ~-1 ~ minecraft:polished_deepslate run fill ~ ~ ~-2 ~ ~2 ~2 minecraft:stone_bricks keep/execute if score #c9_step c9_tick matches 2 as @e[tag=c9_walker,limit=4,sort=random] at @s if block ~ ~-1 ~ minecraft:polished_deepslate run fill ~-2 ~ ~ ~2 ~2 ~ minecraft:stone_bricks keep/execute if score #c9_step c9_tick matches 3 as @e[tag=c9_walker,limit=3,sort=random] at @s if block ~ ~-1 ~ minecraft:polished_deepslate run fill ~ ~ ~ ~ ~3 ~ minecraft:chiseled_deepslate/execute if score #c9_step c9_tick matches 3 as @e[tag=c9_walker,limit=3,sort=random] at @s if block ~ ~3 ~ minecraft:chiseled_deepslate run setblock ~ ~3 ~ minecraft:sea_lantern/execute if score #c9_step c9_tick matches 1..3 as @e[tag=c9_walker,limit=5,sort=random] at @s run particle minecraft:soul_fire_flame ~ ~2.5 ~ 0.4 0.8 0.4 0.03 8 forceloop #2 During the first 25 ticks, the spawner entity summons exactly 25 invisible marker armor stands tagged <code>c9_walker</code> that act as maze construction nodes.loop #3 Uses <code>/spreadplayers</code> on each newly created node to distribute them across the labyrinth floor, then snaps them to block centres with <code>align xz</code>.loop #9 Every 4 ticks, 6 randomly selected nodes clear out adjacent stone bricks, carving fresh doorways and shifting existing hallways so the labyrinth continuously reconfigures.loop #10 Randomly selected builder nodes construct North-South (<code>~ ~ ~-2 ~ ~2 ~2</code>) and East-West (<code>~-2 ~ ~ ~2 ~2 ~</code>) stone brick walls using the <code>keep</code> modifier so pillars are never overwritten.loop #13 Raises 4-block-tall chiseled deepslate junction pillars topped with glowing sea lanterns and emits soul fire flame bursts whenever walls snap into place.


Recorded on our own test server: 57 frames at about 9.5 fps. Our image check saw: A deepslate-walled platform with a glowing cyan central nexus where stone brick walls, deepslate pillars, and sea lanterns assemble amid blue soul flames and purple sparks.
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 the maze construction around themselves in real time, replace @e[tag=c9_spawner] in the second loop command with @a[nbt={SelectedItem:{id:"minecraft:recovery_compass"}}] and add a repeating command that removes old nodes after 5 seconds. Holding a Recovery Compass will then cause self-assembling maze walls to sprout around you as you walk.
/kill @e[tag=c9_lab]/fill ~-16 ~ ~-16 ~16 ~5 ~16 minecraft:air/fill ~-16 ~-1 ~-16 ~16 ~-1 ~16 minecraft:grass_block/scoreboard objectives remove c9_tickNo. The clock counter caps the total number of builder nodes at exactly 25 entities on tick 25 and then loops between ticks 26 and 30 so no more entities are summoned.
Simply run /kill @e[tag=c9_walker] in chat. All construction stops immediately while keeping the current walls, pillars, and lights intact.
/execute/fill/particle/scoreboard/setblock/spreadplayers/summon/tag/tp
▶Procedural Dungeon BuilderSelf-building StructuresHard26 cmds
▶Procedural Floating Dungeon ComplexSelf-building StructuresExpert24 cmds
▶Self-Assembling Dungeon ComplexSelf-building StructuresExpert24 cmds
▶Self-Building Procedural DungeonSelf-building StructuresHard24 cmds
▶Self-Carving LabyrinthSelf-building StructuresHard24 cmds
▶Self-Generating Dungeon MazeSelf-building StructuresExpert24 cmds