Autonomous Rubik's Cube Speed-Solver

A 27-cubie Rubik's Cube made of 81 block displays hovers over a holographic beacon pad, scrambling and solving itself with smooth matrix rotations.

Java EditionHolograms & Display EntitiesExpert24 commandsTested on a real 26.2 & 26.3 server
A glowing Rubik's Cube hovers and twists in mid-air above a beacon pad at night. Download the GIF Video & GIF © www.9minecraft.net

Animated BlocksTechnologyRainbowCyanWhiteDecorationServer LobbyLearningBlock displaysSmooth animation (interpolation)Riding & passengersSummoned mobsBlock building (fill/setblock/clone)Rotation math21+ commands

Suspended above a glowing beacon emitter pad, a 27-cubie Rubik's Cube hovers in mid-air. Each of the 27 cubies is built from three intersecting colored concrete sticker slabs and an obsidian core, forming a 3x3x3 puzzle cube with distinct white, yellow, red, orange, blue, and lime faces.

Driven by a repeating scoreboard clock, individual faces of the cube twist and scramble through 90-degree quaternion interpolations while the entire puzzle rotates smoothly on its axis, finishing each cycle with a rapid self-solve and a celebratory particle burst.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9_timer dummy
  2. /scoreboard players set #tick c9_timer 0
  3. /fill ~-2 ~-1 ~-2 ~2 ~-1 ~2 minecraft:iron_block
  4. /fill ~-2 ~ ~-2 ~2 ~ ~2 minecraft:cyan_stained_glass
  5. /setblock ~ ~-1 ~ minecraft:beacon
  6. /summon minecraft:marker ~-1.4 ~5.5 ~-1.4 {Tags:["c9_x","c9_g"]}
  7. /summon minecraft:marker ~ ~5.5 ~-1.4 {Tags:["c9_x","c9_g"]}
  8. /summon minecraft:marker ~1.4 ~5.5 ~-1.4 {Tags:["c9_x","c9_g"]}
  9. /execute at @e[tag=c9_x] run summon minecraft:marker ~ ~-1.4 ~ {Tags:["c9_xy","c9_g"]}
  10. /execute at @e[tag=c9_x] run summon minecraft:marker ~ ~1.4 ~ {Tags:["c9_xy","c9_g"]}

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

  1. /execute if score #tick c9_timer matches 0..2 at @e[tag=c9_g] run summon minecraft:marker ~ ~ ~ {Tags:["c9_node"]}
  2. /execute if score #tick c9_timer matches 0..1 at @e[tag=c9_g] run tp @s ~ ~ ~1.4
  3. /execute if score #tick c9_timer matches 3 run kill @e[tag=c9_g]
  4. /execute if score #tick c9_timer matches 3 at @e[tag=c9_node] run summon minecraft:area_effect_cloud ~ ~ ~ {Duration:2,Passengers:[{id:"minecraft:block_display",Tags:["c9_cubie"],Glowing:1b,glow_color_override:65535,brightness:{sky:15,block:15},block_state:{Name:"minecraft:obsidian"},transformation:{translation:[-0.62f,-0.62f,-0.62f],scale:[1.24f,1.24f,1.24f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}},{id:"minecraft:block_display",Tags:["c9_cubie","c9_s1"],brightness:{sky:15,block:15},block_state:{Name:"minecraft:white_concrete"},transformation:{translation:[-0.52f,-0.66f,-0.52f],scale:[1.04f,1.32f,1.04f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}},{id:"minecraft:block_display",Tags:["c9_cubie","c9_s2"],brightness:{sky:15,block:15},block_state:{Name:"minecraft:red_concrete"},transformation:{translation:[-0.66f,-0.52f,-0.52f],scale:[1.32f,1.04f,1.04f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}},{id:"minecraft:block_display",Tags:["c9_cubie","c9_s3"],brightness:{sky:15,block:15},block_state:{Name:"minecraft:blue_concrete"},transformation:{translation:[-0.52f,-0.52f,-0.66f],scale:[1.04f,1.04f,1.32f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}]}
  5. /execute if score #tick c9_timer matches 4 positioned ~ ~3.5 ~ as @e[tag=c9_s1,distance=..2.2] run data merge entity @s {block_state:{Name:"minecraft:yellow_concrete"}}
  6. /execute if score #tick c9_timer matches 4 positioned ~-2.0 ~5.5 ~ as @e[tag=c9_s2,distance=..2.2] run data merge entity @s {block_state:{Name:"minecraft:orange_concrete"}}
  7. /execute if score #tick c9_timer matches 4 positioned ~ ~5.5 ~-2.0 as @e[tag=c9_s3,distance=..2.2] run data merge entity @s {block_state:{Name:"minecraft:lime_concrete"}}
  8. /scoreboard players add #tick c9_timer 1
  9. /execute if score #tick c9_timer matches 10.. as @e[tag=c9_cubie] at @s run tp @s ~ ~ ~ ~3 ~
  10. /execute if score #tick c9_timer matches 15 positioned ~1.5 ~5.5 ~ as @e[tag=c9_cubie,distance=..2.3] run data merge entity @s {interpolation_duration:15,start_interpolation:0,transformation:{left_rotation:[0.7071f,0f,0f,0.7071f]}}
  11. /execute if score #tick c9_timer matches 35 positioned ~ ~7.0 ~ as @e[tag=c9_cubie,distance=..2.3] run data merge entity @s {interpolation_duration:15,start_interpolation:0,transformation:{left_rotation:[0f,0.7071f,0f,0.7071f]}}
  12. /execute if score #tick c9_timer matches 55 positioned ~-1.5 ~5.5 ~ as @e[tag=c9_cubie,distance=..2.3] run data merge entity @s {interpolation_duration:15,start_interpolation:0,transformation:{left_rotation:[0f,0f,0.7071f,0.7071f]}}
  13. /execute if score #tick c9_timer matches 80 as @e[tag=c9_cubie] run data merge entity @s {interpolation_duration:20,start_interpolation:0,transformation:{left_rotation:[0f,0f,0f,1f]}}
  14. /execute if score #tick c9_timer matches 115.. run scoreboard players set #tick c9_timer 10

How it works

Frames from the test run

Autonomous Rubik's Cube Speed-Solver - frame 1Autonomous Rubik's Cube Speed-Solver - frame 2Autonomous Rubik's Cube Speed-Solver - frame 3

Recorded on our own test server: 58 frames at about 9.6 fps. Our image check saw: A floating Rubik's cube with a cyan outline hovers above an iron and beacon pad, with its pieces shifting and rotating.

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 at the center of a flat open area with at least 10 blocks of clear air above you.
  2. Run each of the 10 setup commands in chat once to build the beacon emitter pad and place the initial 3x3 grid markers.
  3. Place 14 repeating command blocks in a line or column nearby, set them all to Always Active, and paste the 14 loop commands into them in order.
  4. Watch the 27 cubies assemble in mid-air on tick 3, rotate continuously, and cycle through automatic layer scrambles and speed-solves every 5 seconds.
  5. When you want to remove the build, turn off the repeating command blocks and run the cleanup commands below.

Use it with real players

To let a player trigger the speed-solve manually instead of running on an automatic loop, replace the tick check in loop command 13 (score #tick c9_timer matches 80) with if entity @p[distance=..6,nbt={SelectedItem:{id:"minecraft:amethyst_shard"}}] so holding an amethyst shard near the pad solves the cube on command.

Remove it again 6 commands

  1. /kill @e[tag=c9_cubie]
  2. /kill @e[tag=c9_node]
  3. /kill @e[tag=c9_g]
  4. /scoreboard objectives remove c9_timer
  5. /fill ~-2 ~-1 ~-2 ~2 ~ ~2 minecraft:air
  6. /fill ~-2 ~-1 ~-2 ~2 ~-1 ~2 minecraft:grass_block

FAQ

Why does each cubie use an Area Effect Cloud when spawning?

Summoning multiple block_display entities as passengers of a 2-tick Area Effect Cloud lets a single command spawn the obsidian core and all three sticker axes at the exact same coordinates without keeping extra carrier entities alive.

Can I change the speed of the face twists?

Yes. Lower the interpolation_duration value in loop commands 10 through 13 from 15 to 5 for lightning-fast speed-cubing turns, or raise it to 30 for slow-motion twists.

Commands used

/data/execute/fill/kill/scoreboard/setblock/summon/tp

Similar creations

Join 9Minecraft News & Guides