Automated Explosive Artillery

An automated artillery turret swivels toward orbiting targets and fires calibrated, glowing TNT volleys along high parabolic arcs with fiery explosions.

Java EditionWands, Weapons & ToolsMedium24 commandsTested on a real 26.2 & 26.3 server
An automated Minecraft turret fires arcing TNT shells at floating target blocks in a grassy arena. Download the GIF Video & GIF © www.9minecraft.net

Projectiles & MissilesTechnologyFireOrangeRedWhiteMini-gamePvPMap MakingBlock displaysSmooth animation (interpolation)Summoned mobsBlock building (fill/setblock/clone)Rotation math21+ commands

Place a self-aiming artillery cannon in the centre of your arena and watch it lock onto glowing bullseye targets orbiting around it. Every 1.6 seconds, the amber-outlined barrel swivels smoothly toward the nearest target and lobs a blazing primed TNT shell high into the air.

Each shot is mathematically calibrated to the target's live coordinates so the arcing explosive lands right on mark, erupting in an explosion burst while the target redeploys across the field.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9_t dummy
  2. /fill ~-1 ~ ~-1 ~1 ~ ~1 minecraft:polished_deepslate
  3. /setblock ~ ~1 ~ minecraft:chiseled_deepslate
  4. /summon minecraft:block_display ~ ~2.0 ~ {Tags:["c9_turret","c9_part"],block_state:{Name:"minecraft:oxidized_copper"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-0.55f,0.0f,-0.55f],scale:[1.1f,0.7f,1.1f]}}
  5. /summon minecraft:block_display ~ ~2.35 ~ {Tags:["c9_barrel","c9_part"],teleport_duration:3,Glowing:1b,glow_color_override:16755200,block_state:{Name:"minecraft:netherite_block"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-0.22f,-0.22f,0.0f],scale:[0.44f,0.44f,2.3f]}}
  6. /execute store result score #cx c9_t run data get entity @e[tag=c9_turret,limit=1] Pos[0] 1000
  7. /execute store result score #cz c9_t run data get entity @e[tag=c9_turret,limit=1] Pos[2] 1000
  8. /summon minecraft:block_display ~9 ~2.0 ~5 {Tags:["c9_target","c9_part"],Glowing:1b,glow_color_override:16733525,block_state:{Name:"minecraft:target"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-0.6f,-0.6f,-0.6f],scale:[1.2f,1.2f,1.2f]}}
  9. /summon minecraft:block_display ~-11 ~2.0 ~4 {Tags:["c9_target","c9_part"],Glowing:1b,glow_color_override:16733525,block_state:{Name:"minecraft:target"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-0.6f,-0.6f,-0.6f],scale:[1.2f,1.2f,1.2f]}}
  10. /summon minecraft:block_display ~2 ~2.0 ~-13 {Tags:["c9_target","c9_part"],Glowing:1b,glow_color_override:16733525,block_state:{Name:"minecraft:target"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-0.6f,-0.6f,-0.6f],scale:[1.2f,1.2f,1.2f]}}

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

  1. /scoreboard players add #t c9_t 1
  2. /execute if score #t c9_t matches 32.. run scoreboard players set #t c9_t 0
  3. /execute as @e[tag=c9_target] at @s facing entity @e[tag=c9_turret,limit=1] feet run tp @s ^0.04 ^ ^0.0004 ~ 0
  4. /execute positioned ~ ~2.35 ~ as @e[tag=c9_barrel] facing entity @e[tag=c9_target,sort=nearest,limit=1] feet run tp @s ~ ~ ~ ~ -35
  5. /execute if score #t c9_t matches 0 at @e[tag=c9_barrel,limit=1] run summon minecraft:tnt ^ ^ ^2.2 {fuse:100s,Glowing:1b,Motion:[0.0,0.50,0.0],Tags:["c9_shell","c9_part"]}
  6. /execute if score #t c9_t matches 0 store result score #dx c9_t run data get entity @e[tag=c9_target,sort=nearest,limit=1] Pos[0] 1000
  7. /execute if score #t c9_t matches 0 store result entity @e[tag=c9_shell,sort=nearest,limit=1] Motion[0] double 0.0000394 run scoreboard players operation #dx c9_t -= #cx c9_t
  8. /execute if score #t c9_t matches 0 store result score #dz c9_t run data get entity @e[tag=c9_target,sort=nearest,limit=1] Pos[2] 1000
  9. /execute if score #t c9_t matches 0 store result entity @e[tag=c9_shell,sort=nearest,limit=1] Motion[2] double 0.0000394 run scoreboard players operation #dz c9_t -= #cz c9_t
  10. /execute at @e[tag=c9_shell] run particle minecraft:flame ~ ~0.3 ~ 0.1 0.1 0.1 0.02 3
  11. /execute as @e[tag=c9_shell] at @s unless block ~ ~-0.8 ~ minecraft:air run tag @s add c9_boom
  12. /execute as @e[tag=c9_target] at @s if entity @e[tag=c9_boom,distance=..3.5] facing entity @e[tag=c9_turret,limit=1] feet run tp @s ^3 ^ ^22
  13. /execute at @e[tag=c9_boom] run particle minecraft:explosion_emitter ~ ~0.6 ~ 0.4 0.4 0.4 0 2
  14. /kill @e[tag=c9_boom]

How it works

Frames from the test run

Automated Explosive Artillery - frame 1Automated Explosive Artillery - frame 2Automated Explosive Artillery - frame 3

Recorded on our own test server: 55 frames at about 9.1 fps. Our image check saw: A central turret with an orange-outlined barrel swivels and fires flaming TNT blocks in an arc at floating, glowing target blocks that explode upon impact.

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. Clear a flat 41x41 grass area and stand on the grass block at the exact centre where you want the cannon.
  2. Run each of the 10 setup commands in order from chat or impulse command blocks.
  3. Place 14 repeating command blocks (set to Always Active and Unconditional) in a neat row beside the stage.
  4. Paste the 14 loop commands into the repeating command blocks in order from 1 to 14.
  5. Make sure all repeating command blocks execute centred on your turret coordinates (or place them directly underneath the centre grass block using relative offsets).
  6. Step back and watch the turret swivel, calibrate its shots, and blast the orbiting targets.

Use it with real players

To turn the cannon into a real base defense for players, replace tag=c9_target in the aiming and targeting commands with a hostile mob selector such as type=minecraft:zombie,distance=..18 and add a /damage command at @e[tag=c9_boom] instead of teleporting targets.

Remove it again 3 commands

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

FAQ

Will the TNT shells blow craters into my world?

No. Each shell is summoned with a 5-second fuse and is tagged and removed the instant it reaches ground level, replacing the real detonation with an <code>explosion_emitter</code> particle burst.

How does the cannon hit targets at different distances?

Every time a shell spawns, the loop measures the X and Z distance from the turret to the nearest target and scales the shell's initial <code>Motion</code> vector to match a ~30-tick parabolic arc.

Commands used

/data/execute/fill/kill/particle/scoreboard/setblock/summon/tag/tp

Similar creations

Join 9Minecraft News & Guides