Build an automated pair of heavy artillery cannons that track moving target zones, launch glowing mortar shells in high arcs, and blast targets in Minecraft.
Projectiles & MissilesTechnologyFireIndustrialOrangeRedYellowPvPMap MakingBoss FightBlock displaysItem displaysArmor standsBlock building (fill/setblock/clone)Rotation math21+ commands
This command creation sets up a pair of automated artillery cannons on one side of the field and a moving target zone on the other. Using display entities and scoreboard timers, the battery alternates fire between both cannons without any player input.
Each cannon produces a muzzle blast and launches a glowing mortar shell along a high parabolic arc, leaving a trail of smoke and flames before detonating in a large explosion with a fiery shockwave at the target site.
/scoreboard objectives add c9_t dummy/fill ~-12 ~ ~-6 ~-8 ~ ~6 polished_blackstone_bricks/fill ~8 ~ ~-6 ~12 ~ ~6 deepslate_tiles/summon block_display ~-10 ~1 ~-3 {Tags:["c9_all","c9_gun","c9_g1"],Glowing:1b,glow_color_override:16755200,block_state:{Name:"minecraft:netherite_block"},transformation:{translation:[-0.5f,-0.2f,-0.5f],scale:[2.2f,0.9f,1.0f],left_rotation:[0f,0f,0.259f,0.966f],right_rotation:[0f,0f,0f,1f]}}/summon block_display ~-10 ~1 ~3 {Tags:["c9_all","c9_gun","c9_g2"],Glowing:1b,glow_color_override:16755200,block_state:{Name:"minecraft:netherite_block"},transformation:{translation:[-0.5f,-0.2f,-0.5f],scale:[2.2f,0.9f,1.0f],left_rotation:[0f,0f,0.259f,0.966f],right_rotation:[0f,0f,0f,1f]}}/summon armor_stand ~10 ~ ~-3 {Tags:["c9_all","c9_tgt"],NoGravity:1b,Invisible:1b,Marker:1b}/scoreboard players set #clock c9_t 0/scoreboard players add #clock c9_t 1/execute if score #clock c9_t matches 81.. run scoreboard players set #clock c9_t 1/execute at @e[tag=c9_tgt] run particle dust{color:[1.0,0.15,0.15],scale:2.5} ~ ~0.3 ~ 0.9 0.05 0.9 0 10 force/execute if score #clock c9_t matches 1 at @e[tag=c9_g1] run summon item_display ~1.4 ~1.2 ~ {Tags:["c9_all","c9_shell"],Glowing:1b,glow_color_override:16744192,item:{id:"minecraft:fire_charge",count:1},transformation:{translation:[0f,0f,0f],scale:[1.6f,1.6f,1.6f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}/execute if score #clock c9_t matches 41 at @e[tag=c9_g2] run summon item_display ~1.4 ~1.2 ~ {Tags:["c9_all","c9_shell"],Glowing:1b,glow_color_override:16744192,item:{id:"minecraft:fire_charge",count:1},transformation:{translation:[0f,0f,0f],scale:[1.6f,1.6f,1.6f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}/execute if score #clock c9_t matches 1 at @e[tag=c9_g1] run particle lava ~1.5 ~1.3 ~ 0.2 0.2 0.2 0 12 force/execute if score #clock c9_t matches 41 at @e[tag=c9_g2] run particle lava ~1.5 ~1.3 ~ 0.2 0.2 0.2 0 12 force/execute if score #clock c9_t matches 20 run tp @e[tag=c9_tgt] ~10 ~ ~3/execute if score #clock c9_t matches 60 run tp @e[tag=c9_tgt] ~10 ~ ~-3/scoreboard players add @e[tag=c9_shell] c9_t 1/execute as @e[tag=c9_shell,scores={c9_t=1..20}] at @s facing entity @e[tag=c9_tgt,limit=1] feet run tp @s ^ ^0.45 ^0.52/execute as @e[tag=c9_shell,scores={c9_t=21..38}] at @s facing entity @e[tag=c9_tgt,limit=1] feet run tp @s ^ ^-0.40 ^0.55/execute at @e[tag=c9_shell] run particle flame ~ ~ ~ 0.1 0.1 0.1 0.02 5 force/execute at @e[tag=c9_shell,scores={c9_t=39..}] run particle explosion_emitter ~ ~ ~ 0 0 0 0 1 force/kill @e[tag=c9_shell,scores={c9_t=39..}]setup #4 Summons the first artillery barrel using a glowing <code>block_display</code> entity stretched and tilted upward with a quaternion rotation.loop #4 Every 80 ticks, the first cannon spawns a large glowing fire charge <code>item_display</code> at its muzzle to act as the mortar shell.loop #11 For the first 20 ticks of flight, the shell faces the target marker and teleports forward and upward using local coordinates (<code>^ ^0.45 ^0.52</code>) to climb into a high arc.loop #12 During the second half of flight (ticks 21 to 38), the shell angles downward toward the target marker while moving forward, completing the parabolic trajectory before exploding at tick 39.


Recorded on our own test server: 51 frames at about 8.4 fps. Our image check saw: Two glowing cannon barrels on the left platform fire arcing trails of flame particles toward a glowing orange circle on the right platform.
Commands, video and screenshots: tested and recorded by www.9minecraft.net © 9Minecraft. Sharing a video or screenshot? Please credit www.9minecraft.net.
To have the artillery battery target real players instead of the automated marker, replace @e[tag=c9_tgt,limit=1] in the loop commands with @p[distance=..30] and remove the target teleport commands at loop indices 7 and 8.
/kill @e[tag=c9_all]/fill ~-12 ~ ~-6 ~-8 ~ ~6 air/fill ~8 ~ ~-6 ~12 ~ ~6 air/scoreboard objectives remove c9_tLower the reset threshold in the second loop command from 81 to a smaller number, and adjust the firing ticks (1 and 41) accordingly.
No, the blast uses the explosion_emitter particle effect rather than real TNT, so your builds and terrain stay intact.
▶Magnetic Rail-Track Javelin AssemblerProjectiles & MissilesExpert22 cmds
▶Steampunk Piston-Hammer Pilebunker GauntletProjectiles & MissilesMedium24 cmds
▶16-Way Automated ArtilleryProjectiles & MissilesHard25 cmds
▶Heat-Seeking Rocket LauncherProjectiles & MissilesMedium19 cmds
▶Homing Missile AirstrikeProjectiles & MissilesHard22 cmds
▶Automated Homing Missile SentryProjectiles & MissilesHard21 cmds