Watch twelve scrambled rainbow pillars automatically organize themselves by height and color in 3D using a real-time bubble sort algorithm.
SimulationsTechnologyCelebrationRainbowWhiteCyanLearningDecorationBlock displaysArmor standsSmooth animation (interpolation)Riding & passengersSummoned mobsBlock building (fill/setblock/clone)21+ commands
This command creation brings classic computer science visualization into Minecraft using glowing 3D block displays. Twelve colorful pillars of different heights spawn in a scrambled order across a quartz stage, while a glowing sea lantern pointer scans beneath them from left to right.
Each time the scanner compares two adjacent pillars that are out of order, they smoothly slide past each other and emit bright spark particles. After a few passes across the board, the pillars settle into a clean rainbow staircase before automatically scrambling themselves for another round.
/scoreboard objectives add c9_val dummy/scoreboard objectives add c9_timer dummy/fill ~-7 ~-1 ~-2 ~7 ~-1 ~2 minecraft:quartz_bricks/fill ~-6 ~-1 ~-1 ~6 ~-1 ~1 minecraft:chiseled_quartz_block/summon minecraft:armor_stand ~ ~ ~ {Invisible:1b,NoGravity:1b,Marker:1b,Tags:["c9_all","c9_hub"],Passengers:[{id:"minecraft:block_display",Tags:["c9_all","c9_pil","c9_p1"],Glowing:1b,glow_color_override:16724787,teleport_duration:3,block_state:{Name:"minecraft:red_concrete"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.85f,1.5f,0.85f],translation:[-0.425f,0f,-0.425f]}},{id:"minecraft:block_display",Tags:["c9_all","c9_pil","c9_p2"],Glowing:1b,glow_color_override:16744448,teleport_duration:3,block_state:{Name:"minecraft:orange_concrete"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.85f,2.2f,0.85f],translation:[-0.425f,0f,-0.425f]}},{id:"minecraft:block_display",Tags:["c9_all","c9_pil","c9_p3"],Glowing:1b,glow_color_override:16766720,teleport_duration:3,block_state:{Name:"minecraft:yellow_concrete"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.85f,2.9f,0.85f],translation:[-0.425f,0f,-0.425f]}},{id:"minecraft:block_display",Tags:["c9_all","c9_pil","c9_p4"],Glowing:1b,glow_color_override:8453888,teleport_duration:3,block_state:{Name:"minecraft:lime_concrete"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.85f,3.6f,0.85f],translation:[-0.425f,0f,-0.425f]}}]}/summon minecraft:armor_stand ~ ~ ~ {Invisible:1b,NoGravity:1b,Marker:1b,Tags:["c9_all","c9_hub"],Passengers:[{id:"minecraft:block_display",Tags:["c9_all","c9_pil","c9_p5"],Glowing:1b,glow_color_override:3329330,teleport_duration:3,block_state:{Name:"minecraft:green_concrete"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.85f,4.3f,0.85f],translation:[-0.425f,0f,-0.425f]}},{id:"minecraft:block_display",Tags:["c9_all","c9_pil","c9_p6"],Glowing:1b,glow_color_override:5636095,teleport_duration:3,block_state:{Name:"minecraft:cyan_concrete"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.85f,5.0f,0.85f],translation:[-0.425f,0f,-0.425f]}},{id:"minecraft:block_display",Tags:["c9_all","c9_pil","c9_p7"],Glowing:1b,glow_color_override:39167,teleport_duration:3,block_state:{Name:"minecraft:light_blue_concrete"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.85f,5.7f,0.85f],translation:[-0.425f,0f,-0.425f]}},{id:"minecraft:block_display",Tags:["c9_all","c9_pil","c9_p8"],Glowing:1b,glow_color_override:3368703,teleport_duration:3,block_state:{Name:"minecraft:blue_concrete"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.85f,6.4f,0.85f],translation:[-0.425f,0f,-0.425f]}}]}/summon minecraft:armor_stand ~ ~ ~ {Invisible:1b,NoGravity:1b,Marker:1b,Tags:["c9_all","c9_hub"],Passengers:[{id:"minecraft:block_display",Tags:["c9_all","c9_pil","c9_p9"],Glowing:1b,glow_color_override:10040319,teleport_duration:3,block_state:{Name:"minecraft:purple_concrete"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.85f,7.1f,0.85f],translation:[-0.425f,0f,-0.425f]}},{id:"minecraft:block_display",Tags:["c9_all","c9_pil","c9_p10"],Glowing:1b,glow_color_override:16711935,teleport_duration:3,block_state:{Name:"minecraft:magenta_concrete"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.85f,7.8f,0.85f],translation:[-0.425f,0f,-0.425f]}},{id:"minecraft:block_display",Tags:["c9_all","c9_pil","c9_p11"],Glowing:1b,glow_color_override:16744639,teleport_duration:3,block_state:{Name:"minecraft:pink_concrete"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.85f,8.5f,0.85f],translation:[-0.425f,0f,-0.425f]}},{id:"minecraft:block_display",Tags:["c9_all","c9_pil","c9_p12"],Glowing:1b,glow_color_override:16777215,teleport_duration:3,block_state:{Name:"minecraft:white_concrete"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.85f,9.2f,0.85f],translation:[-0.425f,0f,-0.425f]}}]}/summon minecraft:block_display ~-5.5 ~0.1 ~0.9 {Tags:["c9_all","c9_ptr"],Glowing:1b,glow_color_override:16777215,teleport_duration:2,block_state:{Name:"minecraft:sea_lantern"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[1.95f,0.25f,0.35f],translation:[-0.475f,0f,-0.175f]}}/execute as @e[tag=c9_pil] run ride @s dismount/kill @e[tag=c9_hub]/scoreboard players add #c9_t c9_timer 1/execute if score #c9_t c9_timer matches 280.. run scoreboard players set #c9_t c9_timer 1/execute if score #c9_t c9_timer matches 1 run tp @e[tag=c9_p10] ~-5.5 ~ ~/execute if score #c9_t c9_timer matches 1 run tp @e[tag=c9_p4] ~-4.5 ~ ~/execute if score #c9_t c9_timer matches 1 run tp @e[tag=c9_p12] ~-3.5 ~ ~/execute if score #c9_t c9_timer matches 1 run tp @e[tag=c9_p1] ~-2.5 ~ ~/execute if score #c9_t c9_timer matches 1 as @e[tag=c9_p8] run tp @s ~-1.5 ~ ~/execute if score #c9_t c9_timer matches 1 as @e[tag=c9_p3] run tp @s ~-0.5 ~ ~/execute if score #c9_t c9_timer matches 1 as @e[tag=c9_p11] run tp @s ~0.5 ~ ~/execute if score #c9_t c9_timer matches 1 as @e[tag=c9_p6] run tp @s ~1.5 ~ ~/execute if score #c9_t c9_timer matches 1 as @e[tag=c9_p2] run tp @s ~2.5 ~ ~/execute if score #c9_t c9_timer matches 1 as @e[tag=c9_p9] run tp @s ~3.5 ~ ~/execute if score #c9_t c9_timer matches 1 as @e[tag=c9_p5] run tp @s ~4.5 ~ ~/execute if score #c9_t c9_timer matches 1 as @e[tag=c9_p7] run tp @s ~5.5 ~ ~


Recorded on our own test server: 70 frames at about 9.9 fps. Our image check saw: Twelve glowing colorful pillars of varying heights sit on a white platform with a glowing sea lantern pointer scanning beneath them while adjacent pillars swap positions.
Commands, video and screenshots: tested and recorded by www.9minecraft.net © 9Minecraft. Sharing a video or screenshot? Please credit www.9minecraft.net.
▶Autonomous Bumper Kart DerbySimulationsExpert24 cmds
▶Autonomous Kart ChaosSimulationsExpert26 cmds
▶Autonomous Maze Chaser ArcadeSimulationsExpert24 cmds
▶Four-Dimensional Hypercube Tesseract RotationSimulationsExpert24 cmds
▶Holographic DNA Double-Helix SplicerSimulationsHard24 cmds