Self-Solving Sliding Tile Puzzle

Build an automated 3x3 vertical sliding tile puzzle in Minecraft using glowing block and text display entities framed in deepslate and sea lanterns.

Java EditionHolograms & Display EntitiesHard24 commandsTested on a real 26.2 & 26.3 server
Colorful numbered tiles slide across a vertical 3x3 puzzle board framed by deepslate and sea lanterns. Download the GIF Video & GIF © www.9minecraft.net

Animated BlocksTechnologyRainbowBlackCyanDecorationMini-gameLearningBlock displaysText displaysSmooth animation (interpolation)Riding & passengersBlock building (fill/setblock/clone)21+ commands

This command creation builds a vertical 3x3 sliding tile puzzle set inside a deepslate and sea lantern frame. Eight bright concrete tiles labeled 1 through 8 smoothly glide across the board into the empty slot, solving and scrambling the puzzle on an endless loop.

Each tile combines a block_display with a double-sided text_display passenger and uses built-in transformation interpolation so the slides look fluid from both the front and back of the stage without needing rapid teleportation.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9_t dummy
  2. /fill ~-4 ~1 ~ ~4 ~9 ~ deepslate_tiles
  3. /fill ~-3 ~2 ~ ~3 ~8 ~ sea_lantern
  4. /fill ~-2 ~3 ~ ~2 ~7 ~ black_concrete
  5. /summon block_display ~-2 ~7 ~ {Tags:["c9_e","c9_ctrl","c9_tile","c9_t1"],brightness:{sky:15,block:15},Glowing:1b,glow_color_override:16733525,block_state:{Name:"minecraft:red_concrete"},transformation:{translation:[-0.9f,-0.9f,-0.2f],left_rotation:[0f,0f,0f,1f],scale:[1.8f,1.8f,1.4f],right_rotation:[0f,0f,0f,1f]},Passengers:[{id:"minecraft:text_display",Tags:["c9_e"],brightness:{sky:15,block:15},text:{"text":"1","color":"white","bold":true},background:0,transformation:{translation:[0f,-0.6f,1.25f],left_rotation:[0f,0f,0f,1f],scale:[5f,5f,5f],right_rotation:[0f,0f,0f,1f]}},{id:"minecraft:text_display",Tags:["c9_e"],brightness:{sky:15,block:15},text:{"text":"1","color":"white","bold":true},background:0,transformation:{translation:[0f,-0.6f,-0.25f],left_rotation:[0f,1f,0f,0f],scale:[5f,5f,5f],right_rotation:[0f,0f,0f,1f]}}]}
  6. /summon block_display ~ ~7 ~ {Tags:["c9_e","c9_tile","c9_t2"],brightness:{sky:15,block:15},Glowing:1b,glow_color_override:16755200,block_state:{Name:"minecraft:orange_concrete"},transformation:{translation:[-0.9f,-0.9f,-0.2f],left_rotation:[0f,0f,0f,1f],scale:[1.8f,1.8f,1.4f],right_rotation:[0f,0f,0f,1f]},Passengers:[{id:"minecraft:text_display",Tags:["c9_e"],brightness:{sky:15,block:15},text:{"text":"2","color":"white","bold":true},background:0,transformation:{translation:[0f,-0.6f,1.25f],left_rotation:[0f,0f,0f,1f],scale:[5f,5f,5f],right_rotation:[0f,0f,0f,1f]}},{id:"minecraft:text_display",Tags:["c9_e"],brightness:{sky:15,block:15},text:{"text":"2","color":"white","bold":true},background:0,transformation:{translation:[0f,-0.6f,-0.25f],left_rotation:[0f,1f,0f,0f],scale:[5f,5f,5f],right_rotation:[0f,0f,0f,1f]}}]}
  7. /summon block_display ~2 ~7 ~ {Tags:["c9_e","c9_tile","c9_t3"],brightness:{sky:15,block:15},Glowing:1b,glow_color_override:16777045,block_state:{Name:"minecraft:yellow_concrete"},transformation:{translation:[-0.9f,-0.9f,-0.2f],left_rotation:[0f,0f,0f,1f],scale:[1.8f,1.8f,1.4f],right_rotation:[0f,0f,0f,1f]},Passengers:[{id:"minecraft:text_display",Tags:["c9_e"],brightness:{sky:15,block:15},text:{"text":"3","color":"white","bold":true},background:0,transformation:{translation:[0f,-0.6f,1.25f],left_rotation:[0f,0f,0f,1f],scale:[5f,5f,5f],right_rotation:[0f,0f,0f,1f]}},{id:"minecraft:text_display",Tags:["c9_e"],brightness:{sky:15,block:15},text:{"text":"3","color":"white","bold":true},background:0,transformation:{translation:[0f,-0.6f,-0.25f],left_rotation:[0f,1f,0f,0f],scale:[5f,5f,5f],right_rotation:[0f,0f,0f,1f]}}]}
  8. /summon block_display ~-2 ~5 ~ {Tags:["c9_e","c9_tile","c9_t4"],brightness:{sky:15,block:15},Glowing:1b,glow_color_override:5635925,block_state:{Name:"minecraft:lime_concrete"},transformation:{translation:[-0.9f,-0.9f,-0.2f],left_rotation:[0f,0f,0f,1f],scale:[1.8f,1.8f,1.4f],right_rotation:[0f,0f,0f,1f]},Passengers:[{id:"minecraft:text_display",Tags:["c9_e"],brightness:{sky:15,block:15},text:{"text":"4","color":"white","bold":true},background:0,transformation:{translation:[0f,-0.6f,1.25f],left_rotation:[0f,0f,0f,1f],scale:[5f,5f,5f],right_rotation:[0f,0f,0f,1f]}},{id:"minecraft:text_display",Tags:["c9_e"],brightness:{sky:15,block:15},text:{"text":"4","color":"white","bold":true},background:0,transformation:{translation:[0f,-0.6f,-0.25f],left_rotation:[0f,1f,0f,0f],scale:[5f,5f,5f],right_rotation:[0f,0f,0f,1f]}}]}
  9. /summon block_display ~ ~5 ~ {Tags:["c9_e","c9_tile","c9_t5"],interpolation_duration:8,brightness:{sky:15,block:15},Glowing:1b,glow_color_override:5636095,block_state:{Name:"minecraft:light_blue_concrete"},transformation:{translation:[-0.9f,-0.9f,-0.2f],left_rotation:[0f,0f,0f,1f],scale:[1.8f,1.8f,1.4f],right_rotation:[0f,0f,0f,1f]},Passengers:[{id:"minecraft:text_display",Tags:["c9_e","c9_l5"],interpolation_duration:8,brightness:{sky:15,block:15},billboard:"center",text:{"text":"5","color":"white","bold":true},background:0,transformation:{translation:[0f,-0.5f,0.5f],left_rotation:[0f,0f,0f,1f],scale:[5f,5f,5f],right_rotation:[0f,0f,0f,1f]}},{id:"minecraft:block_display",Tags:["c9_e","c9_tile","c9_t6"],interpolation_duration:8,brightness:{sky:15,block:15},Glowing:1b,glow_color_override:11141290,block_state:{Name:"minecraft:purple_concrete"},transformation:{translation:[1.1f,-0.9f,-0.2f],left_rotation:[0f,0f,0f,1f],scale:[1.8f,1.8f,1.4f],right_rotation:[0f,0f,0f,1f]}},{id:"minecraft:text_display",Tags:["c9_e","c9_l6"],interpolation_duration:8,brightness:{sky:15,block:15},billboard:"center",text:{"text":"6","color":"white","bold":true},background:0,transformation:{translation:[2f,-0.5f,0.5f],left_rotation:[0f,0f,0f,1f],scale:[5f,5f,5f],right_rotation:[0f,0f,0f,1f]}}]}
  10. /summon block_display ~-2 ~3 ~ {Tags:["c9_e","c9_tile","c9_t7"],brightness:{sky:15,block:15},Glowing:1b,glow_color_override:16733695,block_state:{Name:"minecraft:magenta_concrete"},transformation:{translation:[-0.9f,-0.9f,-0.2f],left_rotation:[0f,0f,0f,1f],scale:[1.8f,1.8f,1.4f],right_rotation:[0f,0f,0f,1f]},Passengers:[{id:"minecraft:text_display",Tags:["c9_e"],brightness:{sky:15,block:15},billboard:"center",text:{"text":"7","color":"white","bold":true},background:0,transformation:{translation:[0f,-0.5f,0.5f],left_rotation:[0f,0f,0f,1f],scale:[5f,5f,5f],right_rotation:[0f,0f,0f,1f]}},{id:"minecraft:block_display",Tags:["c9_e","c9_tile","c9_t8"],interpolation_duration:8,brightness:{sky:15,block:15},Glowing:1b,glow_color_override:43690,block_state:{Name:"minecraft:cyan_concrete"},transformation:{translation:[1.1f,-0.9f,-0.2f],left_rotation:[0f,0f,0f,1f],scale:[1.8f,1.8f,1.4f],right_rotation:[0f,0f,0f,1f]}},{id:"minecraft:text_display",Tags:["c9_e","c9_l8"],interpolation_duration:8,brightness:{sky:15,block:15},billboard:"center",text:{"text":"8","color":"white","bold":true},background:0,transformation:{translation:[2f,-0.5f,0.5f],left_rotation:[0f,0f,0f,1f],scale:[5f,5f,5f],right_rotation:[0f,0f,0f,1f]}}]}

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

  1. /scoreboard players add @e[tag=c9_ctrl] c9_t 1
  2. /execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 100.. run scoreboard players set @e[tag=c9_ctrl] c9_t 0
  3. /execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 10 run data merge entity @e[tag=c9_t6,limit=1] {start_interpolation:0,transformation:{translation:[1.1f,-2.9f,-0.2f],left_rotation:[0f,0f,0f,1f],scale:[1.8f,1.8f,1.4f],right_rotation:[0f,0f,0f,1f]}}
  4. /execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 10 run data merge entity @e[tag=c9_l6,limit=1] {start_interpolation:0,transformation:{translation:[2f,-2.5f,0.5f],left_rotation:[0f,0f,0f,1f],scale:[5f,5f,5f],right_rotation:[0f,0f,0f,1f]}}
  5. /execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 25 run data merge entity @e[tag=c9_t5,limit=1] {start_interpolation:0,transformation:{translation:[1.1f,-0.9f,-0.2f],left_rotation:[0f,0f,0f,1f],scale:[1.8f,1.8f,1.4f],right_rotation:[0f,0f,0f,1f]}}
  6. /execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 25 run data merge entity @e[tag=c9_l5,limit=1] {start_interpolation:0,transformation:{translation:[2f,-0.5f,0.5f],left_rotation:[0f,0f,0f,1f],scale:[5f,5f,5f],right_rotation:[0f,0f,0f,1f]}}
  7. /execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 40 run data merge entity @e[tag=c9_t8,limit=1] {start_interpolation:0,transformation:{translation:[1.1f,1.1f,-0.2f],left_rotation:[0f,0f,0f,1f],scale:[1.8f,1.8f,1.4f],right_rotation:[0f,0f,0f,1f]}}
  8. /execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 40 run data merge entity @e[tag=c9_l8,limit=1] {start_interpolation:0,transformation:{translation:[2f,1.5f,0.5f],left_rotation:[0f,0f,0f,1f],scale:[5f,5f,5f],right_rotation:[0f,0f,0f,1f]}}
  9. /execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 55 run data merge entity @e[tag=c9_t8,limit=1] {start_interpolation:0,transformation:{translation:[1.1f,-0.9f,-0.2f],left_rotation:[0f,0f,0f,1f],scale:[1.8f,1.8f,1.4f],right_rotation:[0f,0f,0f,1f]}}
  10. /execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 55 run data merge entity @e[tag=c9_l8,limit=1] {start_interpolation:0,transformation:{translation:[2f,-0.5f,0.5f],left_rotation:[0f,0f,0f,1f],scale:[5f,5f,5f],right_rotation:[0f,0f,0f,1f]}}
  11. /execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 70 run data merge entity @e[tag=c9_t5,limit=1] {start_interpolation:0,transformation:{translation:[-0.9f,-0.9f,-0.2f],left_rotation:[0f,0f,0f,1f],scale:[1.8f,1.8f,1.4f],right_rotation:[0f,0f,0f,1f]}}
  12. /execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 70 run data merge entity @e[tag=c9_l5,limit=1] {start_interpolation:0,transformation:{translation:[0f,-0.5f,0.5f],left_rotation:[0f,0f,0f,1f],scale:[5f,5f,5f],right_rotation:[0f,0f,0f,1f]}}
  13. /execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 85 run data merge entity @e[tag=c9_t6,limit=1] {start_interpolation:0,transformation:{translation:[1.1f,-0.9f,-0.2f],left_rotation:[0f,0f,0f,1f],scale:[1.8f,1.8f,1.4f],right_rotation:[0f,0f,0f,1f]}}
  14. /execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 85 run data merge entity @e[tag=c9_l6,limit=1] {start_interpolation:0,transformation:{translation:[2f,-0.5f,0.5f],left_rotation:[0f,0f,0f,1f],scale:[5f,5f,5f],right_rotation:[0f,0f,0f,1f]}}

How it works

Frames from the test run

Self-Solving Sliding Tile Puzzle - frame 1Self-Solving Sliding Tile Puzzle - frame 2Self-Solving Sliding Tile Puzzle - frame 3

Recorded on our own test server: 58 frames at about 9.6 fps. Our image check saw: A vertical 3x3 sliding tile puzzle in a deepslate and sea lantern frame has colorful tiles sliding around, though only tiles 1 through 4 show their number labels.

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 on a flat open area where you want the puzzle frame to appear.
  2. Run each of the 10 setup commands once in order (or paste them into impulse command blocks) to build the deepslate and sea lantern frame and summon the 8 numbered tiles.
  3. Place a repeating command block set to Always Active for the first loop command, then chain 13 chain command blocks (Always Active, Unconditional) after it for the remaining loop commands.
  4. Watch the numbered concrete tiles automatically slide into the empty slot, scrambling and re-solving the 3x3 grid every 5 seconds.

Use it with real players

To let players slide tiles manually instead of running on a timer, summon an interaction entity in front of each tile slot and replace the scoreboard timer conditions in the loop with /execute on target checks when a player right-clicks an adjacent tile.

Remove it again 3 commands

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

FAQ

Why do the tiles glide smoothly instead of teleporting in steps?

Block and text display entities support native client-side transformation interpolation. Setting interpolation_duration to 8 and start_interpolation to 0 makes Minecraft animate the slide over 8 ticks automatically.

Can I change the speed of the sliding puzzle?

Yes. Lower the interpolation_duration value on the summoned display entities for faster snaps, and adjust the tick numbers (10, 25, 40, 55, 70, 85) in the repeating command loop.

Commands used

/data/execute/fill/scoreboard/summon

Similar creations

Join 9Minecraft News & Guides