Autonomous Basketball Showdown

Watch custom armor stand athletes dribble, pass, and perform a fiery slam dunk with realistic arc physics on a miniature court using only vanilla commands.

Java EditionHolograms & Display EntitiesHard24 commandsTested on a real 26.2 & 26.3 server
Armor stands play basketball on a miniature wooden court, performing a slam dunk over a defender. Download the GIF Video & GIF © www.9minecraft.net

Statues & FiguresFireCelebrationRedBlueOrangeDecorationMini-gameServer LobbyItem displaysArmor standsSmooth animation (interpolation)Block building (fill/setblock/clone)Glowing outlines21+ commands

This command creation builds a miniature basketball court where two custom-dressed armor stand teammates take on a defender in an automated showdown. Using a 120-tick scoreboard cycle, the point guard dribbles down the hardwood, lobs a high-arcing pass over the defender, and sets up the forward for an explosive alley-oop slam dunk.

The basketball is rendered using a scaled item_display entity with smooth teleport interpolation and continuous flame trails. Every dribble, pass, and rim-shaking dunk is synchronized with custom sound effects and particle bursts.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9_t dummy
  2. /fill ~-8 ~-1 ~-5 ~8 ~-1 ~5 stripped_oak_wood
  3. /fill ~-6 ~-1 ~-3 ~6 ~-1 ~3 stripped_birch_wood
  4. /fill ~ ~-1 ~-3 ~ ~-1 ~3 quartz_block
  5. /fill ~6 ~ ~ ~6 ~3 ~ iron_bars
  6. /fill ~6 ~3 ~-1 ~6 ~4 ~1 quartz_block
  7. /setblock ~5 ~3 ~ cobweb
  8. /summon armor_stand ~-5 ~ ~-2 {Tags:["c9_e","c9_p1"],NoGravity:1b,ShowArms:1b,Rotation:[-90f,0f],equipment:{chest:{id:"minecraft:leather_chestplate",components:{"minecraft:dyed_color":16711680}},legs:{id:"minecraft:leather_leggings",components:{"minecraft:dyed_color":16711680}},feet:{id:"minecraft:leather_boots",components:{"minecraft:dyed_color":16777215}},head:{id:"minecraft:player_head"}}}
  9. /summon armor_stand ~-2 ~ ~2 {Tags:["c9_e","c9_p2"],NoGravity:1b,ShowArms:1b,Rotation:[-90f,0f],equipment:{chest:{id:"minecraft:leather_chestplate",components:{"minecraft:dyed_color":16711680}},legs:{id:"minecraft:leather_leggings",components:{"minecraft:dyed_color":16711680}},feet:{id:"minecraft:leather_boots",components:{"minecraft:dyed_color":16777215}},head:{id:"minecraft:player_head"}}}
  10. /summon item_display ~-4 ~1 ~-2 {Tags:["c9_e","c9_ball"],Glowing:1b,glow_color_override:16744192,teleport_duration:2,item:{id:"minecraft:orange_concrete"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[0.45f,0.45f,0.45f]}}

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

  1. /execute unless entity @e[tag=c9_def] run summon armor_stand ~2 ~ ~ {Tags:["c9_e","c9_def"],NoGravity:1b,ShowArms:1b,Rotation:[90f,0f],equipment:{chest:{id:"minecraft:leather_chestplate",components:{"minecraft:dyed_color":255}},legs:{id:"minecraft:leather_leggings",components:{"minecraft:dyed_color":255}},feet:{id:"minecraft:leather_boots",components:{"minecraft:dyed_color":16777215}},head:{id:"minecraft:player_head"}}}
  2. /scoreboard players add #t c9_t 1
  3. /execute if score #t c9_t matches 120.. run scoreboard players set #t c9_t 0
  4. /execute if score #t c9_t matches 1 run tp @e[tag=c9_p1] ~-5 ~ ~-2 -90 0
  5. /execute if score #t c9_t matches 1 run tp @e[tag=c9_p2] ~-2 ~ ~2 -90 0
  6. /execute if score #t c9_t matches 1..30 as @e[tag=c9_p1] at @s run tp @s ~0.12 ~ ~
  7. /execute if score #t c9_t matches 1..30 at @e[tag=c9_p1] run tp @e[tag=c9_ball] ~0.6 ~0.8 ~
  8. /execute if score #t c9_t matches 8 at @e[tag=c9_p1] run tp @e[tag=c9_ball] ~0.6 ~0.2 ~
  9. /execute if score #t c9_t matches 22 at @e[tag=c9_p1] run tp @e[tag=c9_ball] ~0.6 ~0.2 ~
  10. /execute if score #t c9_t matches 31..55 as @e[tag=c9_ball] at @s run tp @s ~0.07 ~0.06 ~0.16
  11. /execute if score #t c9_t matches 56..85 as @e[tag=c9_p2] at @s run tp @s ~0.22 ~0.1 ~-0.07 -90 -20
  12. /execute if score #t c9_t matches 56..85 at @e[tag=c9_p2] run tp @e[tag=c9_ball] ~0.5 ~1.8 ~
  13. /execute if score #t c9_t matches 86 at @e[tag=c9_ball] run particle explosion ~ ~ ~ 0.2 0.2 0.2 0.1 10
  14. /execute at @e[tag=c9_ball] run particle flame ~ ~ ~ 0.05 0.05 0.05 0.01 2

How it works

Frames from the test run

Autonomous Basketball Showdown - frame 1Autonomous Basketball Showdown - frame 2Autonomous Basketball Showdown - frame 3

Recorded on our own test server: 59 frames at about 9.8 fps. Our image check saw: On a miniature wooden basketball court with a cobweb hoop, two red-armored stands execute an alley-oop dunk over a blue-armored defender using an orange item as a basketball.

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 41x41 area where you want your basketball court built.
  2. Run each of the 10 setup commands in chat one by one to construct the hardwood court, hoop, players, and basketball.
  3. Place 14 repeating command blocks in a line or column near the court, set them all to 'Needs Redstone' first, and paste one loop command into each block.
  4. Switch all 14 repeating command blocks to 'Always Active' so the 120-tick basketball play loop begins.
  5. Watch the red team dribble, pass over the blue defender, and slam dunk into the hoop every 6 seconds.

Use it with real players

To let real players control the ball instead of the automated armor stands, replace the timed teleport commands with an execute command that teleports @e[tag=c9_ball] relative to the nearest player holding a tripwire hook (acting as a basketball controller), and launch the ball forward using motion vectors when the player drops the item.

Remove it again 4 commands

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

FAQ

Why does the basketball move so smoothly between bounces?

The basketball is an item_display entity configured with teleport_duration set to 2 ticks, which tells the Minecraft client to smoothly interpolate its position whenever a command teleports it.

Can I change the team jersey colors?

Yes! Edit the dyed_color integer values inside the leather armor equipment components in the summon commands for c9_p1, c9_p2, and c9_def to any decimal RGB color code.

Commands used

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

Similar creations

Join 9Minecraft News & Guides