Procedural Labyrinth Carver

Glowing builder cursors zip across a solid deepslate monolith, carving out a complex winding maze completely by themselves with particles and sound.

Java EditionComplex Contraptions & CinematicsHard25 commandsTested on a real 26.2 & 26.3 server
Glowing cursors carve a sea-lantern maze out of dark deepslate bricks in Minecraft. Download the GIF Video & GIF © www.9minecraft.net

Self-building StructuresTechnologyDarkCyanBlackWhiteBuilding ToolMap MakingMini-gameBlock displaysSmooth animation (interpolation)Summoned mobsBlock building (fill/setblock/clone)Rotation math21+ commands

Watch a solid block of dark deepslate bricks transform into a glowing labyrinth right before your eyes. Four autonomous sea-lantern cursors zip across the grid in real time, hunting for uncarved stone and hollowing out winding corridors while leaving a trail of electric sparks and lantern-lit floors.

This creation uses a decentralized randomized breadth-first search algorithm built entirely with vanilla commands. When a cursor hits a dead end, it automatically teleports to a previously carved junction to branch out until the entire maze is complete.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9_tick dummy
  2. /fill ~-12 ~-1 ~-12 ~12 ~-1 ~12 minecraft:polished_deepslate
  3. /fill ~-11 ~ ~-11 ~11 ~2 ~11 minecraft:deepslate_bricks
  4. /fill ~-10 ~ ~-10 ~-10 ~2 ~-10 minecraft:air
  5. /setblock ~-10 ~-1 ~-10 minecraft:ochre_froglight
  6. /summon minecraft:marker ~-10 ~ ~-10 {Tags:["c9_sim","c9_node"]}
  7. /summon minecraft:block_display ~-10 ~ ~-10 {Tags:["c9_sim","c9_carver"],Glowing:1b,glow_color_override:65535,teleport_duration:2,block_state:{Name:"minecraft:sea_lantern"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.8f,2.8f,0.8f],translation:[-0.4f,0f,-0.4f]}}
  8. /summon minecraft:block_display ~-10 ~ ~-10 {Tags:["c9_sim","c9_carver"],Glowing:1b,glow_color_override:16755200,teleport_duration:2,block_state:{Name:"minecraft:shroomlight"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.8f,2.8f,0.8f],translation:[-0.4f,0f,-0.4f]}}
  9. /summon minecraft:block_display ~-10 ~ ~-10 {Tags:["c9_sim","c9_carver"],Glowing:1b,glow_color_override:65535,teleport_duration:2,block_state:{Name:"minecraft:sea_lantern"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.8f,2.8f,0.8f],translation:[-0.4f,0f,-0.4f]}}
  10. /summon minecraft:block_display ~-10 ~ ~-10 {Tags:["c9_sim","c9_carver"],Glowing:1b,glow_color_override:16755200,teleport_duration:2,block_state:{Name:"minecraft:shroomlight"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.8f,2.8f,0.8f],translation:[-0.4f,0f,-0.4f]}}

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

  1. /scoreboard players add #timer c9_tick 1
  2. /execute as @e[tag=c9_carver] at @s run particle minecraft:electric_spark ~ ~1.5 ~ 0.3 0.8 0.3 0.05 4 force
  3. /execute if score #timer c9_tick matches 2.. run tag @e[tag=c9_carver] remove c9_moved
  4. /execute if score #timer c9_tick matches 2.. as @e[tag=c9_carver] at @s run tp @s ~ ~ ~ ~90 ~
  5. /execute if score #timer c9_tick matches 2.. as @e[tag=c9_carver,limit=1,sort=random] at @s run tp @s ~ ~ ~ ~180 ~
  6. /execute if score #timer c9_tick matches 2.. as @e[tag=c9_carver,tag=!c9_moved] at @s positioned ^ ^ ^2 if block ~ ~-1 ~ minecraft:polished_deepslate if block ~ ~ ~ minecraft:deepslate_bricks run summon minecraft:marker ~ ~ ~ {Tags:["c9_sim","c9_node","c9_step"]}
  7. /execute if score #timer c9_tick matches 2.. as @e[tag=c9_carver,tag=!c9_moved] at @s if entity @e[tag=c9_step,distance=..2.5] run fill ^ ^ ^1 ^ ^2 ^2 minecraft:air
  8. /execute if score #timer c9_tick matches 2.. as @e[tag=c9_carver,tag=!c9_moved] at @s if entity @e[tag=c9_step,distance=..2.5] run setblock ^ ^-1 ^1 minecraft:sea_lantern
  9. /execute if score #timer c9_tick matches 2.. as @e[tag=c9_carver,tag=!c9_moved] at @s if entity @e[tag=c9_step,distance=..2.5] run tp @s ^ ^ ^2
  10. /execute if score #timer c9_tick matches 2.. as @e[tag=c9_carver,tag=!c9_moved] at @s if entity @e[tag=c9_step,distance=..0.5] run tag @s add c9_moved
  11. /execute if score #timer c9_tick matches 2.. at @e[tag=c9_step] run setblock ~ ~-1 ~ minecraft:ochre_froglight
  12. /execute if score #timer c9_tick matches 2.. at @e[tag=c9_step] run particle minecraft:soul_fire_flame ~ ~1 ~ 0.2 0.8 0.2 0.05 15 force
  13. /execute if score #timer c9_tick matches 2.. as @e[tag=c9_carver,tag=!c9_moved] at @s run tp @s @e[tag=c9_node,limit=1,sort=random]
  14. /execute if score #timer c9_tick matches 2.. run tag @e[tag=c9_step] remove c9_step
  15. /execute if score #timer c9_tick matches 2.. run scoreboard players set #timer c9_tick 0

How it works

Frames from the test run

Procedural Labyrinth Carver - frame 1Procedural Labyrinth Carver - frame 2Procedural Labyrinth Carver - frame 3

Recorded on our own test server: 68 frames at about 9.7 fps. Our image check saw: Four glowing outlined cursors move across a large block of deepslate bricks, actively carving out maze corridors with sea-lantern floors and particle effects.

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 in the center of a flat open area with at least 15 blocks of clearance in every direction.
  2. Run the 10 setup commands in order in your chat or from an impulse command block to build the deepslate monolith and spawn the 4 glowing carver cursors.
  3. Place a repeating command block set to Always Active near the build, and paste in the first loop command.
  4. Attach 14 chain command blocks (set to Always Active and Unconditional) in a line coming out of the repeating command block.
  5. Paste loop commands 2 through 15 into the chain command blocks in exact order and watch the cursors carve the labyrinth.

Use it with real players

To let players trigger a fresh maze rewrite with an item, remove the setup monolith fills and instead run them through an execute at @a[nbt={SelectedItem:{id:"minecraft:golden_pickaxe"}}] detector, centering the maze around the player whenever they drop the pickaxe.

Remove it again 4 commands

  1. /kill @e[tag=c9_sim]
  2. /scoreboard objectives remove c9_tick
  3. /fill ~-12 ~ ~-12 ~12 ~3 ~12 minecraft:air
  4. /fill ~-12 ~-1 ~-12 ~12 ~-1 ~12 minecraft:grass_block

FAQ

Why do the cursors never carve loops into the maze?

Each cursor checks two blocks ahead on an odd-numbered coordinate grid and only carves if the target cell is still solid deepslate bricks, which guarantees a perfect spanning tree without closed loops.

How can I reset the maze and generate a brand new layout?

Run the remove commands to clear the markers and blocks, then run the setup commands again. Because the cursors rotate and branch randomly, every single run produces a different maze.

Commands used

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

Similar creations

Join 9Minecraft News & Guides