Build a self-playing giant slot machine in Minecraft Java using display entities, spinning reels, golden jackpot coins, and celebratory fireworks.
Confetti & CelebrationCelebrationRoyalGoldRedCyanMini-gameServer LobbyDecorationParticlesItem displaysFireworksScoreboard timersExecute chainsSummoned mobsBlock building (fill/setblock/clone)Glowing outlinesRotation math21+ commands
This command creation builds a giant, golden casino slot machine right in the center of your world. Using floating item display entities, three oversized reels spin through glowing symbols before locking into a triple-seven diamond jackpot one by one.
The moment all three reels lock in, the machine erupts with celebratory fireworks, a fountain of spinning gold coins, and glowing emerald rings. Everything runs automatically on a repeating timer without needing any mods or data packs.
/scoreboard objectives add c9_t dummy/fill ~-4 ~ ~-1 ~4 ~7 ~2 red_concrete/fill ~-4 ~ ~-1 ~4 ~1 ~2 gold_block/fill ~-4 ~7 ~-1 ~4 ~7 ~2 gold_block/fill ~-3 ~2 ~-1 ~3 ~5 ~-1 black_concrete/fill ~-3 ~6 ~-1 ~3 ~6 ~-1 glowstone/summon marker ~ ~ ~ {Tags:["c9_slot","c9_ctrl"]}/summon item_display ~-2 ~3.5 ~-1.3 {Tags:["c9_slot","c9_r1"],Glowing:1b,glow_color_override:65535,item:{id:"minecraft:diamond",count:1},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[1.8f,1.8f,1.8f]}}/summon item_display ~ ~3.5 ~-1.3 {Tags:["c9_slot","c9_r2"],Glowing:1b,glow_color_override:65535,item:{id:"minecraft:diamond",count:1},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[1.8f,1.8f,1.8f]}}/summon item_display ~2 ~3.5 ~-1.3 {Tags:["c9_slot","c9_r3"],Glowing:1b,glow_color_override:65535,item:{id:"minecraft:diamond",count:1},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[1.8f,1.8f,1.8f]}}/scoreboard players add @e[tag=c9_ctrl] c9_t 1/execute if entity @e[tag=c9_ctrl,scores={c9_t=140..}] run scoreboard players set @e[tag=c9_ctrl] c9_t 0/execute if entity @e[tag=c9_ctrl,scores={c9_t=1..80}] as @e[tag=c9_slot,type=item_display] at @s run tp @s ~ ~ ~ ~36 ~/execute if entity @e[tag=c9_ctrl,scores={c9_t=20}] as @e[tag=c9_slot,type=item_display] run data modify entity @s item.id set value "minecraft:emerald"/execute if entity @e[tag=c9_ctrl,scores={c9_t=40}] as @e[tag=c9_slot,type=item_display] run data modify entity @s item.id set value "minecraft:golden_apple"/execute if entity @e[tag=c9_ctrl,scores={c9_t=55}] as @e[tag=c9_r1] at @s run tp @s ~ ~ ~ 0 0/execute if entity @e[tag=c9_ctrl,scores={c9_t=55}] as @e[tag=c9_r1] run data modify entity @s item.id set value "minecraft:diamond"/execute if entity @e[tag=c9_ctrl,scores={c9_t=68}] as @e[tag=c9_r2] at @s run tp @s ~ ~ ~ 0 0/execute if entity @e[tag=c9_ctrl,scores={c9_t=68}] as @e[tag=c9_r2] run data modify entity @s item.id set value "minecraft:diamond"/execute if entity @e[tag=c9_ctrl,scores={c9_t=80}] as @e[tag=c9_r3] at @s run tp @s ~ ~ ~ 0 0/execute if entity @e[tag=c9_ctrl,scores={c9_t=80}] as @e[tag=c9_r3] run data modify entity @s item.id set value "minecraft:diamond"/execute if entity @e[tag=c9_ctrl,scores={c9_t=81..130}] run particle dust{color:[1.0,0.85,0.0],scale:2.0} ~ ~3.5 ~-1.5 2.5 1.5 0.5 0 15 force/execute if entity @e[tag=c9_ctrl,scores={c9_t=81..125}] run summon item ~ ~1.8 ~-1.5 {Tags:["c9_slot","c9_coin"],Item:{id:"minecraft:gold_ingot",count:1},PickupDelay:32767,Age:5960,Motion:[0.0,0.5,-0.35]}/execute if entity @e[tag=c9_ctrl,scores={c9_t=82}] run summon firework_rocket ~-3 ~7 ~-1 {LifeTime:12,FireworksItem:{id:"minecraft:firework_rocket",count:1,components:{"minecraft:fireworks":{flight_duration:1,explosions:[{shape:"large_ball",has_twinkle:1b,colors:[I;16766720,65280],fade_colors:[I;16777215]}]}}}}setup #8 Summons the first oversized reel symbol using an <code>item_display</code> entity scaled up to 1.8x size with a cyan glow override.loop #3 Spins all three reel display entities rapidly during the first 80 ticks of the cycle by rotating their yaw 36 degrees every tick.loop #7 Locks the first reel into a diamond at tick 55, followed by the second and third reels at ticks 68 and 80 for a sequential slot machine stop.loop #13 Ejects golden coin items from the front tray during the jackpot phase with <code>Age:5960</code> so they automatically despawn after two seconds without causing lag.loop #14 Fires a celebratory golden and green large-ball firework rocket from the top of the cabinet when the jackpot hits.


Recorded on our own test server: 59 frames at about 9.8 fps. Our image check saw: A large red and gold block structure representing a slot machine with three glowing cyan-outlined symbols spinning and locking in the center.
Commands, video and screenshots: tested and recorded by www.9minecraft.net © 9Minecraft. Sharing a video or screenshot? Please credit www.9minecraft.net.
To let players pull a lever instead of looping automatically, remove the second loop command that resets c9_t at 140, and attach a lever on the side of the machine to a command block running /scoreboard players set @e[tag=c9_ctrl] c9_t 1 whenever a player wants to spin.
/kill @e[tag=c9_slot]/fill ~-4 ~ ~-1 ~4 ~7 ~2 air/scoreboard objectives remove c9_tNo. Each summoned gold ingot has its Age set to 5960 ticks (out of 6000) and PickupDelay locked, so every coin disappears automatically after 2 seconds.
Yes! Edit the item IDs inside the data modify loop commands from emerald, golden_apple, and diamond to any item ID you like, such as nether_star or tnt.
▶Festive Confetti Cannon SaluteConfetti & CelebrationEasy23 cmds
▶Automated Firecracker ShowConfetti & CelebrationEasy20 cmds
▶Explosive Confetti PiñataConfetti & CelebrationEasy24 cmds
▶New Year Crystal Ball DropConfetti & CelebrationHard24 cmds
▶Giant Champagne Pop Confetti CelebrationConfetti & CelebrationMedium24 cmds
▶Unfolding Fabergé Egg Starlight TreasuryFirework ShowsExpert24 cmds