Generate an interconnected maze of dark stone rooms, carpeted floors, and soul lantern lighting that branches outward from a glowing central core.
Self-building StructuresDarkMedievalCyanBlackBuilding ToolAdventure MapMap MakingBlock displaysBlock building (fill/setblock/clone)13-20 commands
The Self-Expanding Dungeon uses invisible marker entities to automatically generate an interconnected maze of dark stone rooms, cyan carpeted floors, and hanging soul lanterns. Starting from a glowing central core, builder nodes branch out along a 5-block grid in all four cardinal directions, carving archways between adjacent chambers and leaving the ceiling coated in glass so you can watch the interior maze take shape.
Each newly spawned room bursts with soul fire and glowing cyan particles while floating builder nodes pulse above the chambers, turning a flat platform into a full dungeon layout in seconds.
/scoreboard objectives add c9_t dummy/fill ~-17 ~ ~-17 ~17 ~8 ~17 air/fill ~-17 ~-1 ~-17 ~17 ~-1 ~17 polished_deepslate/summon marker ~ ~ ~ {Tags:["c9_core"]}/summon marker ~ ~ ~ {Tags:["c9_b"]}/summon block_display ~-0.5 ~2.5 ~-0.5 {Tags:["c9_d"],Glowing:1b,glow_color_override:5636095,block_state:{Name:"minecraft:sea_lantern"}}/scoreboard players add @e[tag=c9_core] c9_t 1/execute if score @e[tag=c9_core,limit=1] c9_t matches 15.. run scoreboard players set @e[tag=c9_core] c9_t 0/execute as @e[tag=c9_b] at @s run particle dust{color:[0.0,0.95,1.0],scale:1.6} ~ ~2.2 ~ 0.6 0.4 0.6 0 4 force/execute if score @e[tag=c9_core,limit=1] c9_t matches 1 as @e[tag=c9_b] at @s run fill ~-2 ~-1 ~-2 ~2 ~3 ~2 deepslate_bricks hollow/execute if score @e[tag=c9_core,limit=1] c9_t matches 1 as @e[tag=c9_b] at @s run fill ~-1 ~3 ~-1 ~1 ~3 ~1 cyan_stained_glass/execute if score @e[tag=c9_core,limit=1] c9_t matches 1 as @e[tag=c9_b] at @s run fill ~-1 ~ ~-1 ~1 ~ ~1 cyan_carpet/execute if score @e[tag=c9_core,limit=1] c9_t matches 1 as @e[tag=c9_b] at @s run setblock ~ ~2 ~ soul_lantern[hanging=true]/execute if score @e[tag=c9_core,limit=1] c9_t matches 1 as @e[tag=c9_b] at @s run particle soul_fire_flame ~ ~1.5 ~ 1.2 0.8 1.2 0.05 35 force/execute if score @e[tag=c9_core,limit=1] c9_t matches 2 as @e[tag=c9_b] at @s if block ~ ~ ~4 cyan_carpet run fill ~-1 ~ ~2 ~1 ~2 ~3 air/execute if score @e[tag=c9_core,limit=1] c9_t matches 2 as @e[tag=c9_b] at @s if block ~4 ~ ~ cyan_carpet run fill ~2 ~ ~-1 ~3 ~2 ~1 air/execute if score @e[tag=c9_core,limit=1] c9_t matches 3 as @e[tag=c9_b,limit=2,sort=random] at @s positioned ~5 ~ ~ if entity @e[tag=c9_core,distance=..15] unless entity @e[tag=c9_b,distance=..2] run summon marker ~ ~ ~ {Tags:["c9_b"]}/execute if score @e[tag=c9_core,limit=1] c9_t matches 3 as @e[tag=c9_b,limit=2,sort=random] at @s positioned ~-5 ~ ~ if entity @e[tag=c9_core,distance=..15] unless entity @e[tag=c9_b,distance=..2] run summon marker ~ ~ ~ {Tags:["c9_b"]}/execute if score @e[tag=c9_core,limit=1] c9_t matches 3 as @e[tag=c9_b,limit=2,sort=random] at @s positioned ~ ~ ~5 if entity @e[tag=c9_core,distance=..15] unless entity @e[tag=c9_b,distance=..2] run summon marker ~ ~ ~ {Tags:["c9_b"]}/execute if score @e[tag=c9_core,limit=1] c9_t matches 3 as @e[tag=c9_b,limit=2,sort=random] at @s positioned ~ ~ ~-5 if entity @e[tag=c9_core,distance=..15] unless entity @e[tag=c9_b,distance=..2] run summon marker ~ ~ ~ {Tags:["c9_b"]}loop #4 On tick 1 of each 15-tick cycle, every active builder marker uses <code>/fill ... hollow</code> to construct a 5x5x5 deepslate brick chamber around itself.loop #5 Replaces the centre of each chamber's ceiling with <code>cyan_stained_glass</code> so the glowing soul lanterns and carpets inside are visible from above.loop #9 On tick 2, each room checks 4 blocks south for the <code>cyan_carpet</code> of a neighbouring room and carves a 3x3 doorway through both touching walls.loop #11 On tick 3, randomly chosen builder nodes step 5 blocks along a cardinal axis and summon a new builder marker if it is within 15 blocks of the core and no room exists there yet.


Recorded on our own test server: 59 frames at about 9.7 fps. Our image check saw: A grid of dark stone rooms with glass ceilings and cyan floors automatically expands across a stone platform.
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 trigger a dungeon expansion wherever they throw an item or stand, summon the c9_core and initial c9_b markers at @p instead of ~ ~ ~. You can also increase the distance=..15 check on the last four loop commands to distance=..35 for a much larger labyrinth.
/kill @e[tag=c9_core]/kill @e[tag=c9_b]/kill @e[tag=c9_d]/scoreboard objectives remove c9_t/fill ~-17 ~ ~-17 ~17 ~8 ~17 air/fill ~-17 ~-1 ~-17 ~17 ~-1 ~17 grass_blockThe four branching commands check if entity @e[tag=c9_core,distance=..15] before summoning a new node, capping the dungeon at a 7x7 grid of rooms (at most 49 lightweight marker entities).
Yes! Change deepslate_bricks, cyan_carpet, and cyan_stained_glass in the loop commands to any blocks you prefer, as long as the doorway check in commands 9 and 10 matches the new floor carpet block.
▶Automated Dungeon BuilderSelf-building StructuresHard26 cmds
▶Procedural Dungeon BuilderSelf-building StructuresHard26 cmds
▶Procedural Dungeon GeneratorSelf-building StructuresExpert24 cmds
▶Procedural Floating Dungeon ComplexSelf-building StructuresExpert24 cmds
▶Self-Building Dungeon MazeSelf-building StructuresHard24 cmds
▶Self-Building Procedural DungeonSelf-building StructuresExpert24 cmds