Build a self-expanding sci-fi laboratory in vanilla Minecraft using glowing probe entities that carve out lighted corridors, junctions, and glass windows.
Self-building StructuresTechnologyIndustrialSpaceWhiteCyanBuilding ToolMap MakingAdventure MapBlock displaysArmor standsBlock building (fill/setblock/clone)Rotation math21+ commands
Watch an automated laboratory complex assemble itself right in front of you. Starting from a glowing central beacon hub, four glowing builder probes shoot outward in cardinal directions, stamping down clean white iron walls, cyan glass viewing windows, and overhead sea lantern light strips.
As the probes travel, they periodically branch off at 90-degree angles to form intersections and side hallways, emitting bursts of cyan energy particles as each slice of the corridor is constructed.
/scoreboard objectives add c9_t dummy/fill ~-17 ~ ~-17 ~17 ~6 ~17 air/fill ~-2 ~ ~-2 ~2 ~4 ~2 iron_block hollow/fill ~-1 ~4 ~-1 ~1 ~4 ~1 sea_lantern/summon marker ~ ~1 ~ {Tags:["c9_all","c9_center"]}/summon block_display ~-0.5 ~1.5 ~-0.5 {Tags:["c9_all","c9_core"],Glowing:1b,glow_color_override:65535,block_state:{Name:"minecraft:beacon"}}/summon armor_stand ~ ~1 ~ {Tags:["c9_all","c9_b"],NoGravity:1b,Glowing:1b,Small:1b,Rotation:[0f,0f]}/summon armor_stand ~ ~1 ~ {Tags:["c9_all","c9_b"],NoGravity:1b,Glowing:1b,Small:1b,Rotation:[90f,0f]}/summon armor_stand ~ ~1 ~ {Tags:["c9_all","c9_b"],NoGravity:1b,Glowing:1b,Small:1b,Rotation:[180f,0f]}/summon armor_stand ~ ~1 ~ {Tags:["c9_all","c9_b"],NoGravity:1b,Glowing:1b,Small:1b,Rotation:[270f,0f]}/scoreboard players add @e[tag=c9_b] c9_t 1/execute as @e[tag=c9_b,scores={c9_t=3..}] at @s if block ^ ^ ^3 iron_block run fill ^-1 ^ ^1 ^1 ^2 ^3 air/execute as @e[tag=c9_b,scores={c9_t=3..}] at @s if block ^ ^ ^3 iron_block run kill @s/execute as @e[tag=c9_b,scores={c9_t=3..}] at @s run tp @s ^ ^ ^1/execute as @e[tag=c9_b,scores={c9_t=3..}] at @s run fill ^-2 ^-1 ^2 ^2 ^3 ^2 iron_block/execute as @e[tag=c9_b,scores={c9_t=3..}] at @s run fill ^-2 ^1 ^2 ^2 ^1 ^2 cyan_stained_glass/execute as @e[tag=c9_b,scores={c9_t=3..}] at @s run fill ^-1 ^ ^1 ^1 ^2 ^2 air/execute as @e[tag=c9_b,scores={c9_t=3..}] at @s run setblock ^ ^3 ^2 sea_lantern/execute as @e[tag=c9_b,scores={c9_t=3..}] at @s run particle dust{color:[0.1,0.9,1.0],scale:1.6} ^ ^1.2 ^2 0.8 0.8 0.8 0 15/execute as @e[tag=c9_b,scores={c9_t=4..},limit=12] at @s if entity @e[tag=c9_center,distance=4..12] unless entity @e[tag=c9_b,distance=0.1..4] run summon armor_stand ~ ~ ~ {Tags:["c9_all","c9_b","c9_turn"],NoGravity:1b,Glowing:1b,Small:1b}/execute as @e[tag=c9_turn] at @s store result entity @s Rotation[0] float 90 run random value 0..3/tag @e[tag=c9_turn] remove c9_turn/execute at @e[tag=c9_center] run kill @e[tag=c9_b,distance=14..]/scoreboard players set @e[tag=c9_b,scores={c9_t=3..}] c9_t 0setup #5 Summons an invisible <code>c9_center</code> marker at the middle of the hub so builder probes can always measure their distance from the origin using standard target selectors.loop #2 Checks if a probe is about to collide with an existing <code>iron_block</code> wall ahead, and carves a doorway through it so colliding hallways merge cleanly into T-junctions.loop #5 Uses local coordinates (<code>^ ^ ^</code>) relative to the probe's facing direction to stamp a 5x5 iron cross-section 2 blocks ahead, which is then hollowed out and fitted with glass windows and a ceiling light.loop #10 When a probe is between 4 and 12 blocks from the center and no other probes are nearby, it spawns a new branching probe tagged <code>c9_turn</code>.loop #11 Generates a random integer from 0 to 3 with <code>/random value 0..3</code>, multiplies it by 90, and stores it directly into the new probe's <code>Rotation[0]</code> yaw NBT tag.loop #13 Executes from the center marker and removes any builder probe that reaches 14 blocks away, keeping the lab neatly inside the stage boundaries.


Recorded on our own test server: 57 frames at about 9.4 fps. Our image check saw: A four-way cross-shaped corridor made of iron blocks, cyan glass, and sea lanterns sits stationary without branching off or changing across the frames.
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 carve corridors manually wherever they look, remove the automatic tp and branching commands, and instead run the local ^ ^ ^ fill commands at @a[nbt={SelectedItem:{id:"minecraft:Debug_stick"}}] rotated ~ 0 so walking forward stamps out a tunnel around you in real time.
/kill @e[tag=c9_all]/fill ~-17 ~-1 ~-17 ~17 ~6 ~17 air/fill ~-17 ~-1 ~-17 ~17 ~-1 ~17 grass_block/scoreboard objectives remove c9_tIncrease the distance check in loop command 10 (for example, <code>distance=4..40</code>) and raise the cleanup radius in loop command 13 (for example, <code>distance=45..</code>).
Caret coordinates are relative to the direction an entity is facing, allowing a single set of <code>/fill</code> commands to build walls, windows, and ceilings correctly whether the probe faces north, south, east, or west.
/execute/fill/kill/particle/random/scoreboard/setblock/summon/tag/tp
▶Mechanical Spider Silk Web SpinnerSelf-building StructuresHard24 cmds
▶Automated Orbital Block PrinterSelf-building StructuresHard24 cmds
▶Dyson Sphere Megastructure EncasementSelf-building StructuresExpert24 cmds
▶Instant Metropolis GeneratorSelf-building StructuresHard24 cmds
▶Instant Procedural MetropolisSelf-building StructuresExpert26 cmds
▶Procedural Terrain PrinterSelf-building StructuresExpert24 cmds