Self-Playing Mechanical Tune Box

Build a giant animated mechanical music box in vanilla Minecraft where rotating copper pins physically pluck golden comb teeth to play a continuous melody.

Java EditionHolograms & Display EntitiesMedium24 commandsTested on a real 26.2 & 26.3 server
An oversized mechanical music box in Minecraft with five glowing golden teeth and note particles at night. Download the GIF Video & GIF © www.9minecraft.net

Machines & MechanismsMusicIndustrialOrangeGoldDecorationServer LobbyBlock displaysSmooth animation (interpolation)Block building (fill/setblock/clone)Sounds21+ commands

This command creation builds a working oversized mechanical music box right in the middle of your world. A brass-and-copper cylinder spins continuously while glowing pins travel over the top and strike five golden comb teeth in sequence.

Each time a pin reaches the front edge, the corresponding tooth vibrates downward, releases musical note particles, and plays a chime harmony. Everything uses vanilla block display entities and scoreboard timing with zero mods or resource packs.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9_t dummy
  2. /fill ~-4 ~ ~-2 ~4 ~ ~2 dark_oak_planks
  3. /fill ~-4 ~1 ~-2 ~-4 ~3 ~-2 gold_block
  4. /fill ~4 ~1 ~-2 ~4 ~3 ~-2 gold_block
  5. /summon block_display ~ ~2.5 ~-0.5 {Tags:["c9_mb","c9_cyl"],transformation:{translation:[-3.0f,-0.8f,-0.8f],scale:[6.0f,1.6f,1.6f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},block_state:{Name:"minecraft:copper_block"}}
  6. /summon block_display ~ ~2.5 ~1.2 {Tags:["c9_mb","c9_bar"],transformation:{translation:[-3.2f,-0.3f,-0.2f],scale:[6.4f,0.4f,0.6f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},block_state:{Name:"minecraft:iron_block"}}
  7. /summon block_display ~-2 ~2.5 ~0.4 {Tags:["c9_mb","c9_tooth","c9_t1"],Glowing:1b,glow_color_override:16766720,transformation:{translation:[-0.15f,-0.05f,0f],scale:[0.3f,0.1f,0.9f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},block_state:{Name:"minecraft:gold_block"}}
  8. /summon block_display ~-1 ~2.5 ~0.4 {Tags:["c9_mb","c9_tooth","c9_t2"],Glowing:1b,glow_color_override:16766720,transformation:{translation:[-0.15f,-0.05f,0f],scale:[0.3f,0.1f,0.9f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},block_state:{Name:"minecraft:gold_block"}}
  9. /summon block_display ~ ~2.5 ~0.4 {Tags:["c9_mb","c9_tooth","c9_t3"],Glowing:1b,glow_color_override:16766720,transformation:{translation:[-0.15f,-0.05f,0f],scale:[0.3f,0.1f,0.9f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},block_state:{Name:"minecraft:gold_block"}}
  10. /summon block_display ~1 ~2.5 ~0.4 {Tags:["c9_mb","c9_tooth","c9_t4"],Glowing:1b,glow_color_override:16766720,transformation:{translation:[-0.15f,-0.05f,0f],scale:[0.3f,0.1f,0.9f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},block_state:{Name:"minecraft:gold_block"}}

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

  1. /execute unless entity @e[tag=c9_t5] run summon block_display ~2 ~2.5 ~0.4 {Tags:["c9_mb","c9_tooth","c9_t5"],Glowing:1b,glow_color_override:16766720,transformation:{translation:[-0.15f,-0.05f,0f],scale:[0.3f,0.1f,0.9f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},block_state:{Name:"minecraft:gold_block"}}
  2. /scoreboard players add #c9_clk c9_t 1
  3. /execute if score #c9_clk c9_t matches 100.. run scoreboard players set #c9_clk c9_t 0
  4. /execute as @e[tag=c9_tooth] run data merge entity @s {interpolation_duration:2,start_interpolation:0,transformation:{translation:[-0.15f,-0.05f,0f],scale:[0.3f,0.1f,0.9f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}
  5. /execute if score #c9_clk c9_t matches 1 run summon block_display ~-2 ~3.3 ~-1.1 {Tags:["c9_mb","c9_pin"],Glowing:1b,glow_color_override:16755200,transformation:{translation:[-0.1f,-0.1f,-0.1f],scale:[0.2f,0.2f,0.2f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},block_state:{Name:"minecraft:lightning_rod"}}
  6. /execute if score #c9_clk c9_t matches 21 run summon block_display ~ ~3.3 ~-1.1 {Tags:["c9_mb","c9_pin"],Glowing:1b,glow_color_override:16755200,transformation:{translation:[-0.1f,-0.1f,-0.1f],scale:[0.2f,0.2f,0.2f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},block_state:{Name:"minecraft:lightning_rod"}}
  7. /execute if score #c9_clk c9_t matches 41 run summon block_display ~2 ~3.3 ~-1.1 {Tags:["c9_mb","c9_pin"],Glowing:1b,glow_color_override:16755200,transformation:{translation:[-0.1f,-0.1f,-0.1f],scale:[0.2f,0.2f,0.2f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},block_state:{Name:"minecraft:lightning_rod"}}
  8. /execute if score #c9_clk c9_t matches 61 run summon block_display ~1 ~3.3 ~-1.1 {Tags:["c9_mb","c9_pin"],Glowing:1b,glow_color_override:16755200,transformation:{translation:[-0.1f,-0.1f,-0.1f],scale:[0.2f,0.2f,0.2f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},block_state:{Name:"minecraft:lightning_rod"}}
  9. /execute if score #c9_clk c9_t matches 81 run summon block_display ~-1 ~3.3 ~-1.1 {Tags:["c9_mb","c9_pin"],Glowing:1b,glow_color_override:16755200,transformation:{translation:[-0.1f,-0.1f,-0.1f],scale:[0.2f,0.2f,0.2f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},block_state:{Name:"minecraft:lightning_rod"}}
  10. /execute as @e[tag=c9_pin] at @s run tp @s ~ ~-0.028 ~0.05
  11. /execute as @e[tag=c9_pin] at @s if entity @e[tag=c9_tooth,distance=..0.35] run particle note ~ ~0.3 ~ 0.1 0.1 0.1 1 2 force
  12. /execute as @e[tag=c9_pin] at @s if entity @e[tag=c9_tooth,distance=..0.35] run playsound block.note_block.chime master @a ~ ~ ~ 1.5 1.2
  13. /execute as @e[tag=c9_tooth] at @s if entity @e[tag=c9_pin,distance=..0.35] run data merge entity @s {interpolation_duration:1,start_interpolation:0,transformation:{translation:[-0.15f,-0.25f,0f],scale:[0.3f,0.1f,0.9f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}
  14. /execute as @e[tag=c9_pin] at @s if entity @e[tag=c9_bar,distance=..1.4] run kill @s

How it works

Frames from the test run

Self-Playing Mechanical Tune Box - frame 1Self-Playing Mechanical Tune Box - frame 2Self-Playing Mechanical Tune Box - frame 3

Recorded on our own test server: 60 frames at about 9.8 fps. Our image check saw: A large mechanical music box with a reddish cylinder, five glowing golden teeth, moving pins, and musical note particles when pins hit the teeth.

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 centre of the music box to sit.
  2. Run each of the 10 setup commands once in chat or in impulse command blocks to build the base, copper drum, iron comb bar, and golden comb teeth.
  3. Place 14 repeating command blocks (or 1 repeating block chained into 13 chain blocks), all set to Always Active.
  4. Paste the 14 loop commands in order into those blocks.
  5. Watch as glowing pins automatically spawn along the cylinder, roll into the golden teeth, pluck them downward, and play a chiming melody.

Use it with real players

To make the music box play only when a player winds it up, add execute if entity @a[distance=..8] run in front of the second loop command (/scoreboard players add #c9_clk c9_t 1). The cylinder pins will pause whenever players walk away and resume when someone comes close.

Remove it again 3 commands

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

FAQ

Can I change the instrument or melody?

Yes! Replace block.note_block.chime in loop command 12 with any other note block sound such as block.note_block.harp or block.note_block.bell, and adjust the pitch value at the end of the command.

Will the summoned pins cause lag over time?

No. Loop command 14 immediately removes each pin right after it plucks a comb tooth, so there are never more than two or three pins alive at once.

Commands used

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

Similar creations

Join 9Minecraft News & Guides