Self-Building Endless Labyrinth

Watch a glowing constructor drone rapidly build a procedural deepslate labyrinth outward from a central crystal shrine, complete with buzzing ceiling lights.

Java EditionMini-games & UtilitiesMedium24 commandsTested on a real 26.2 & 26.3 server
An overhead view of a lit deepslate-brick Minecraft labyrinth with a central crystal and glowing beacon. Download the GIF Video & GIF © www.9minecraft.net

Spawners & GeneratorsTechnologyDarkMysticBlackCyanBlueMini-gameMap MakingBuilding ToolBlock displaysSmooth animation (interpolation)Summoned mobsBlock building (fill/setblock/clone)Rotation math21+ commands

From a glowing crystal shrine at the center, a hovering beacon drone shoots outward across the grass, raising uniform deepslate_bricks walls, carving 3-wide corridors, and switching on overhead sea_lantern lights as it goes.

Each run generates a brand-new branching maze using a growing-tree algorithm driven entirely by marker entities. When a corridor hits the outer border or runs out of room, the drone warps back to an active junction to sprout another wing until the whole grid is filled with sparking ceiling lights.

1. Setup - type these once 10 commands

  1. /fill ~-18 ~-1 ~-18 ~18 ~-1 ~18 minecraft:polished_deepslate
  2. /fill ~-14 ~-1 ~-14 ~14 ~-1 ~14 minecraft:grass_block
  3. /fill ~-2 ~-1 ~-2 ~2 ~2 ~2 minecraft:polished_deepslate hollow
  4. /summon minecraft:end_crystal ~ ~3.2 ~ {ShowBottom:0b,Invulnerable:1b,Tags:["c9_core"]}
  5. /summon minecraft:marker ~ ~3 ~ {Tags:["c9_front"]}
  6. /summon minecraft:block_display ~ ~ ~ {Tags:["c9_head"],block_state:{Name:"minecraft:beacon"},glowing:1b,brightness:{sky:15,block:15},teleport_duration:1,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-0.4f,1.2f,-0.4f],scale:[0.8f,0.8f,0.8f]}}
  7. /summon minecraft:marker ~ ~ ~ {Tags:["c9_dir"],Rotation:[0.0f,0.0f]}
  8. /summon minecraft:marker ~ ~ ~ {Tags:["c9_dir"],Rotation:[90.0f,0.0f]}
  9. /summon minecraft:marker ~ ~ ~ {Tags:["c9_dir"],Rotation:[180.0f,0.0f]}
  10. /summon minecraft:marker ~ ~ ~ {Tags:["c9_dir"],Rotation:[-90.0f,0.0f]}

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

  1. /tag @e[type=marker,tag=c9_dir] remove c9_valid
  2. /tag @e[type=marker,tag=c9_dir] remove c9_pick
  3. /execute at @e[type=block_display,tag=c9_head] as @e[type=marker,tag=c9_dir] rotated as @s if block ^ ^-1 ^4 minecraft:grass_block run tag @s add c9_valid
  4. /execute as @e[type=marker,tag=c9_valid,sort=random,limit=1] run tag @s add c9_pick
  5. /execute if entity @e[type=marker,tag=c9_pick] at @e[type=block_display,tag=c9_head] rotated as @e[type=marker,tag=c9_pick,limit=1] run tp @e[type=block_display,tag=c9_head] ^ ^ ^4
  6. /execute if entity @e[type=marker,tag=c9_pick] at @e[type=block_display,tag=c9_head] run fill ~-2 ~-1 ~-2 ~2 ~2 ~2 minecraft:deepslate_bricks
  7. /execute if entity @e[type=marker,tag=c9_pick] at @e[type=block_display,tag=c9_head] run fill ~-1 ~0 ~-1 ~1 ~2 ~1 minecraft:air
  8. /execute if entity @e[type=marker,tag=c9_pick] at @e[type=block_display,tag=c9_head] rotated as @e[type=marker,tag=c9_pick,limit=1] run fill ^-1 ^0 ^-2 ^1 ^2 ^-2 minecraft:air
  9. /execute if entity @e[type=marker,tag=c9_pick] at @e[type=block_display,tag=c9_head] run setblock ~ ~3 ~ minecraft:sea_lantern
  10. /execute if entity @e[type=marker,tag=c9_pick] at @e[type=block_display,tag=c9_head] run summon minecraft:marker ~ ~3 ~ {Tags:["c9_light","c9_front"]}
  11. /execute unless entity @e[type=marker,tag=c9_pick] at @e[type=block_display,tag=c9_head] run tag @e[type=marker,tag=c9_front,distance=..3.5] remove c9_front
  12. /execute unless entity @e[type=marker,tag=c9_pick] at @e[type=marker,tag=c9_front,sort=random,limit=1] run tp @e[type=block_display,tag=c9_head] ~ ~-3 ~
  13. /execute at @e[type=block_display,tag=c9_head] run particle minecraft:dust{color:[0.15,0.95,1.0],scale:1.4} ~ ~1.6 ~ 0.6 0.6 0.6 0 8
  14. /execute at @e[type=marker,tag=c9_light,sort=random,limit=6] run particle minecraft:electric_spark ~ ~ ~ 0.35 0.15 0.35 0.02 4

How it works

Frames from the test run

Self-Building Endless Labyrinth - frame 1Self-Building Endless Labyrinth - frame 2Self-Building Endless Labyrinth - frame 3

Recorded on our own test server: 47 frames at about 9.4 fps. Our image check saw: An overhead view of a completed deepslate-brick labyrinth with 3-wide corridors, overhead sea lanterns, a central end crystal, and a blue particle-emitting beacon nearby, though no active building motion is visible across the three nearly identical frames.

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 grassy area at least 37x37 blocks wide and stand at the exact center.
  2. Run the 10 setup commands in order to lay the border frame, central crystal shrine, and direction markers.
  3. Place 14 Repeating Command Blocks set to Always Active (or 1 Repeating followed by 13 Chain Always Active blocks) somewhere nearby.
  4. Paste each of the 14 loop commands into the command blocks in order.
  5. Watch the glowing drone expand the procedural labyrinth outward, then explore the lit corridors once it finishes.

Use it with real players

This creation runs automatically around its starting point with no special items required. Players can walk directly into the central shrine and explore the corridors as they build, or run the remove and setup commands at a new location to generate a fresh maze layout.

Remove it again 7 commands

  1. /kill @e[tag=c9_head]
  2. /kill @e[tag=c9_core]
  3. /kill @e[tag=c9_dir]
  4. /kill @e[tag=c9_light]
  5. /kill @e[tag=c9_front]
  6. /fill ~-18 ~0 ~-18 ~18 ~5 ~18 minecraft:air
  7. /fill ~-18 ~-1 ~-18 ~18 ~-1 ~18 minecraft:grass_block

FAQ

How do I generate a different maze layout?

Run the <code>remove</code> commands to reset the grass platform, then run the <code>setup</code> commands again. Because directions and frontier jumps use <code>sort=random</code>, every run creates a unique labyrinth.

Why does the drone stop moving after a few seconds?

Once all 49 cells in the 7x7 grid have been built and every dead end has been checked, all <code>c9_front</code> markers are cleared. The maze is complete while the ceiling lights keep buzzing.

Commands used

/execute/fill/particle/setblock/summon/tag/tp

Similar creations

Join 9Minecraft News & Guides