Self-Solving Giant Puzzle Cube

Build a giant floating puzzle cube in Minecraft using block display entities that smoothly rotates its faces along all three axes to scramble and solve itself.

Java EditionHolograms & Display EntitiesExpert25 commandsTested on a real 26.2 & 26.3 server
A glowing glazed terracotta puzzle cube floats and rotates above a dark prismarine pedestal at night. Download the GIF Video & GIF © www.9minecraft.net

Animated BlocksTechnologyMysticRainbowDecorationMini-gameServer LobbyBlock displaysSmooth animation (interpolation)Block building (fill/setblock/clone)Sounds21+ commands

This command creation builds a massive 2x2x2 color puzzle cube floating in mid-air above a dark prismarine pedestal. Each corner cubie is made of a colorful glazed terracotta block display entity with glowing outlines and full brightness so the patterns stand out at night.

Using block display transformation matrices and smooth interpolation, the cube automatically picks faces along the X, Y, and Z axes and twists them 90 degrees at a time. After scrambling itself across three axes, it reverses every rotation step-by-step until the puzzle is completely solved, letting out a burst of particles and celebratory chimes.

1. Setup - type these once 11 commands

  1. /scoreboard objectives add c9_t dummy
  2. /fill ~-2 ~ ~-2 ~2 ~ ~2 dark_prismarine_slab[type=bottom]
  3. /setblock ~ ~ ~ sea_lantern
  4. /summon block_display ~ ~5.5 ~ {Tags:["c9_cube","c9_px","c9_py","c9_pz"],Glowing:1b,glow_color_override:16733525,brightness:{sky:15,block:15},teleport_duration:10,interpolation_duration:14,block_state:{Name:"minecraft:red_glazed_terracotta"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[1.6f,1.6f,1.6f],translation:[0.05f,0.05f,0.05f]}}
  5. /summon block_display ~ ~5.5 ~ {Tags:["c9_cube","c9_nx","c9_py","c9_pz"],Glowing:1b,glow_color_override:16755200,brightness:{sky:15,block:15},teleport_duration:10,interpolation_duration:14,block_state:{Name:"minecraft:orange_glazed_terracotta"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[1.6f,1.6f,1.6f],translation:[-1.65f,0.05f,0.05f]}}
  6. /summon block_display ~ ~5.5 ~ {Tags:["c9_cube","c9_px","c9_ny","c9_pz"],Glowing:1b,glow_color_override:16777045,brightness:{sky:15,block:15},teleport_duration:10,interpolation_duration:14,block_state:{Name:"minecraft:yellow_glazed_terracotta"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[1.6f,1.6f,1.6f],translation:[0.05f,-1.65f,0.05f]}}
  7. /summon block_display ~ ~5.5 ~ {Tags:["c9_cube","c9_nx","c9_ny","c9_pz"],Glowing:1b,glow_color_override:5635925,brightness:{sky:15,block:15},teleport_duration:10,interpolation_duration:14,block_state:{Name:"minecraft:lime_glazed_terracotta"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[1.6f,1.6f,1.6f],translation:[-1.65f,-1.65f,0.05f]}}
  8. /summon block_display ~ ~5.5 ~ {Tags:["c9_cube","c9_px","c9_py","c9_nz"],Glowing:1b,glow_color_override:5636095,brightness:{sky:15,block:15},teleport_duration:10,interpolation_duration:14,block_state:{Name:"minecraft:cyan_glazed_terracotta"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[1.6f,1.6f,1.6f],translation:[0.05f,0.05f,-1.65f]}}
  9. /summon block_display ~ ~5.5 ~ {Tags:["c9_cube","c9_nx","c9_py","c9_nz"],Glowing:1b,glow_color_override:5592575,brightness:{sky:15,block:15},teleport_duration:10,interpolation_duration:14,block_state:{Name:"minecraft:blue_glazed_terracotta"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[1.6f,1.6f,1.6f],translation:[-1.65f,0.05f,-1.65f]}}
  10. /summon block_display ~ ~5.5 ~ {Tags:["c9_cube","c9_px","c9_ny","c9_nz"],Glowing:1b,glow_color_override:16733695,brightness:{sky:15,block:15},teleport_duration:10,interpolation_duration:14,block_state:{Name:"minecraft:magenta_glazed_terracotta"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[1.6f,1.6f,1.6f],translation:[0.05f,-1.65f,-1.65f]}}
  11. /summon block_display ~ ~5.5 ~ {Tags:["c9_cube","c9_nx","c9_ny","c9_nz"],Glowing:1b,glow_color_override:16777215,brightness:{sky:15,block:15},teleport_duration:10,interpolation_duration:14,block_state:{Name:"minecraft:white_glazed_terracotta"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[1.6f,1.6f,1.6f],translation:[-1.65f,-1.65f,-1.65f]}}

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

  1. /scoreboard players add #tick c9_t 1
  2. /execute if score #tick c9_t matches 140.. run scoreboard players set #tick c9_t 1
  3. /execute if score #tick c9_t matches 1..70 run tp @e[tag=c9_cube] ~ ~5.8 ~ ~2 ~
  4. /execute if score #tick c9_t matches 71..140 run tp @e[tag=c9_cube] ~ ~5.2 ~ ~2 ~
  5. /particle end_rod ~ ~5.5 ~ 1.8 1.8 1.8 0.01 1 force
  6. /particle dust{color:[0.2,0.9,1.0],scale:1.2} ~ ~1.2 ~ 0.8 0.2 0.8 0 3 force
  7. /execute if score #tick c9_t matches 10 as @e[tag=c9_py] run data merge entity @s {start_interpolation:0,interpolation_duration:14,transformation:{left_rotation:[0f,0.7071068f,0f,0.7071068f]}}
  8. /execute if score #tick c9_t matches 30 as @e[tag=c9_px] run data merge entity @s {start_interpolation:0,interpolation_duration:14,transformation:{right_rotation:[0.7071068f,0f,0f,0.7071068f]}}
  9. /execute if score #tick c9_t matches 50 as @e[tag=c9_pz] run data merge entity @s {start_interpolation:0,interpolation_duration:14,transformation:{left_rotation:[0f,0f,0.7071068f,0.7071068f]}}
  10. /execute if score #tick c9_t matches 75 as @e[tag=c9_pz] run data merge entity @s {start_interpolation:0,interpolation_duration:14,transformation:{left_rotation:[0f,0f,0f,1f]}}
  11. /execute if score #tick c9_t matches 95 as @e[tag=c9_px] run data merge entity @s {start_interpolation:0,interpolation_duration:14,transformation:{right_rotation:[0f,0f,0f,1f]}}
  12. /execute if score #tick c9_t matches 115 as @e[tag=c9_py] run data merge entity @s {start_interpolation:0,interpolation_duration:14,transformation:{left_rotation:[0f,0f,0f,1f]}}
  13. /execute if score #tick c9_t matches 10..115 if score #tick c9_t matches 10 run playsound minecraft:block.piston.extend master @a ~ ~5.5 ~ 0.7 1.4
  14. /execute if score #tick c9_t matches 130 run particle totem_of_undying ~ ~5.5 ~ 1.2 1.2 1.2 0.15 35 force

How it works

Frames from the test run

Self-Solving Giant Puzzle Cube - frame 1Self-Solving Giant Puzzle Cube - frame 2Self-Solving Giant Puzzle Cube - frame 3

Recorded on our own test server: 69 frames at about 9.8 fps. Our image check saw: A glowing 2x2x2 cube of colorful glazed terracotta blocks floats above a dark prismarine pedestal at night, with its left side shifting and rotating to change block positions while emitting particles.

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. Enable command blocks in your world and stand at the center of a flat clearing.
  2. Run each of the 11 setup commands in chat or in an impulse command block to create the scoreboard objective, the glowing pedestal, and the 8 corner cubie display entities.
  3. Place a line of 14 repeating command blocks (set to Always Active) or 1 repeating command block connected to 13 chain command blocks.
  4. Paste the 14 loop commands in order into the command blocks.
  5. Note that the relative coordinates (~ ~ ~) in the loop commands assume they are executed from the center of the pedestal; wrap them with execute positioned X Y Z run ... if your command blocks are placed elsewhere.
  6. Watch the floating puzzle cube twist its top, right, and front faces to scramble itself, then reverse every move to solve itself!

Use it with real players

To let players trigger the scramble and solve sequence manually instead of looping automatically, replace the automatic reset in loop command 2 with a right-click detection or a button wired to /scoreboard players set #tick c9_t 1, and only increment #tick while it is below 140.

Remove it again 3 commands

  1. /kill @e[tag=c9_cube]
  2. /scoreboard objectives remove c9_t
  3. /fill ~-2 ~ ~-2 ~2 ~ ~2 air

FAQ

How do the blocks rotate around the center of the big cube instead of their own corner?

All eight block_display entities are summoned at the exact same coordinate (~ ~5.5 ~) and pushed outward into their 2x2x2 slots using the transformation translation vector. When left_rotation or right_rotation is updated, it pivots the translated block around the entity's origin at the center of the cube.

Can I change the speed of the face turns?

Yes! Lower the interpolation_duration value in the loop commands (for example from 14 to 6) for snappy speed-cube turns, or raise it to 25 for a slow, heavy mechanical turn.

Commands used

/data/execute/fill/particle/playsound/scoreboard/setblock/summon/tp

Similar creations

Join 9Minecraft News & Guides