Watch a detailed custom WWI artillery cannon made of block displays automatically recoil, fire arcing shells, and bombard a sandbag trench line with explosions.
Machines & MechanismsIndustrialTechnologyFireBlackOrangeYellowDecorationCinematicMap MakingBlock displaysItem displaysArmor standsSmooth animation (interpolation)Riding & passengersBlock building (fill/setblock/clone)Sounds21+ commands
This command creation builds an automated vintage battlefield diorama using custom block display entities. At one end of the field stands a heavy howitzer cannon constructed from netherite, grindstone wheels, and iron carriage struts, aimed directly at an entrenched bunker fortified with sandbags and barbed wire.
Every few seconds, the artillery piece fires a glowing shell along a parabolic trajectory. Using display entity transformation interpolation, the cannon barrel kicks backward with realistic recoil while muzzle flash particles erupt, followed shortly by a fiery detonation at the enemy trench.
/scoreboard objectives add c9_t dummy/fill ~-8 ~-1 ~-4 ~8 ~-1 ~4 coarse_dirt/fill ~4 ~-1 ~-3 ~6 ~-1 ~3 mud/fill ~3 ~ ~-3 ~3 ~ ~3 sandstone_slab[type=bottom]/fill ~2 ~ ~-2 ~2 ~ ~2 cobweb/summon marker ~ ~ ~ {Tags:["c9_all","c9_ctrl"]}/summon block_display ~-6 ~0.4 ~ {Tags:["c9_all","c9_base"],block_state:{Name:"minecraft:dark_oak_planks"},transformation:{translation:[-1.0f,-0.2f,-0.4f],scale:[2.2f,0.35f,0.8f]},Passengers:[{id:"minecraft:block_display",Tags:["c9_all"],block_state:{Name:"minecraft:grindstone",Properties:{face:"floor",facing:"east"}},transformation:{translation:[-0.5f,-0.4f,-0.7f],scale:[1.2f,1.2f,0.5f]}},{id:"minecraft:block_display",Tags:["c9_all"],block_state:{Name:"minecraft:grindstone",Properties:{face:"floor",facing:"east"}},transformation:{translation:[-0.5f,-0.4f,0.4f],scale:[1.2f,1.2f,0.5f]}},{id:"minecraft:block_display",Tags:["c9_all"],block_state:{Name:"minecraft:iron_block"},transformation:{translation:[0.2f,0.1f,-0.75f],scale:[0.2f,1.3f,1.5f]}}]}/summon block_display ~-6 ~1.1 ~ {Tags:["c9_all","c9_barrel"],interpolation_duration:4,block_state:{Name:"minecraft:netherite_block"},transformation:{left_rotation:[0.0f,0.0f,0.173f,0.985f],translation:[-0.8f,0.0f,-0.25f],scale:[2.8f,0.5f,0.5f]}}/summon armor_stand ~-5.2 ~1.1 ~ {Tags:["c9_all","c9_crew"],Invisible:0b,NoBasePlate:1b,ShowArms:1b,Rotation:[-90f,0f],equipment:{head:{id:"minecraft:turtle_helmet"},chest:{id:"minecraft:leather_chestplate",components:{"minecraft:dyed_color":5592405}},legs:{id:"minecraft:leather_leggings",components:{"minecraft:dyed_color":5592405}},feet:{id:"minecraft:leather_boots",components:{"minecraft:dyed_color":2236962}},mainhand:{id:"minecraft:spyglass"}}}/summon armor_stand ~5 ~0.2 ~ {Tags:["c9_all","c9_target"],Invisible:0b,NoBasePlate:1b,ShowArms:1b,Rotation:[90f,0f],equipment:{head:{id:"minecraft:iron_helmet"},chest:{id:"minecraft:leather_chestplate",components:{"minecraft:dyed_color":3355443}},mainhand:{id:"minecraft:crossbow"}}}/execute as @e[tag=c9_ctrl] run scoreboard players add @s c9_t 1/execute as @e[tag=c9_ctrl,scores={c9_t=80..}] run scoreboard players set @s c9_t 0/execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 10 as @e[tag=c9_barrel] run data merge entity @s {start_interpolation:0,interpolation_duration:2,transformation:{left_rotation:[0.0f,0.0f,0.22f,0.975f],translation:[-1.5f,-0.15f,-0.25f],scale:[2.8f,0.5f,0.5f]}}/execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 10 run particle campfire_cosy_smoke ~-3.8 ~1.8 ~ 0.3 0.3 0.3 0.05 25 force/execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 10 run particle flame ~-3.8 ~1.8 ~ 0.2 0.2 0.2 0.1 30 force/execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 10 run playsound entity.generic.explode master @a ~-4 ~1.8 ~ 1.2 0.7/execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 10 run summon item_display ~-3.8 ~1.8 ~ {Tags:["c9_all","c9_shell"],Glowing:1b,item:{id:"minecraft:fire_charge"},transformation:{scale:[0.8f,0.8f,0.8f]}}/execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 15 as @e[tag=c9_barrel] run data merge entity @s {start_interpolation:0,interpolation_duration:15,transformation:{left_rotation:[0.0f,0.0f,0.173f,0.985f],translation:[-0.8f,0.0f,-0.25f],scale:[2.8f,0.5f,0.5f]}}/execute as @e[tag=c9_shell] at @s run scoreboard players add @s c9_t 1/execute as @e[tag=c9_shell,scores={c9_t=1..10}] at @s run tp @s ~0.44 ~0.25 ~/execute as @e[tag=c9_shell,scores={c9_t=11..20}] at @s run tp @s ~0.44 ~-0.37 ~/execute as @e[tag=c9_shell] at @s run particle large_smoke ~ ~ ~ 0.05 0.05 0.05 0.01 3 force/execute as @e[tag=c9_shell,scores={c9_t=20}] at @s run particle explosion_emitter ~ ~ ~ 0 0 0 1 1 force/execute as @e[tag=c9_shell,scores={c9_t=20}] at @s run kill @ssetup #7 Summons the artillery carriage using a parent <code>block_display</code> with three passenger displays for the grindstone wheels and armored gun shield.setup #8 Summons the netherite cannon barrel tilted upward using a quaternion <code>left_rotation</code> so it points toward the trench.loop #3 At tick 10 of the cycle, merges a new transformation into the barrel with a 2-tick <code>interpolation_duration</code>, sliding it backward to simulate heavy firing recoil.loop #8 Five ticks after firing, smoothly slides the barrel back into its resting battery position over 15 ticks.loop #10 Moves the glowing artillery shell forward and upward during the first 10 ticks of flight, then command 10 drops it downward into the enemy trench.


Recorded on our own test server: 49 frames at about 9.8 fps. Our image check saw: A small dirt battlefield diorama features a custom block-display cannon firing a smoky parabolic projectile toward a trench fortified with sandstone and cobwebs.
Commands, video and screenshots: tested and recorded by www.9minecraft.net © 9Minecraft. Sharing a video or screenshot? Please credit www.9minecraft.net.
To fire the artillery manually instead of on an automatic loop, remove the first two loop commands and set /scoreboard players set @e[tag=c9_ctrl] c9_t 10 whenever a player presses a button or right-clicks an item near the cannon crew.
/kill @e[tag=c9_all]/scoreboard objectives remove c9_t/fill ~-8 ~ ~-4 ~8 ~2 ~4 air/fill ~-8 ~-1 ~-4 ~8 ~-1 ~4 grass_blockNo, the bombardment uses particle effects and display entities rather than real TNT, so your world builds and terrain remain completely safe.
In the second loop command, change the score check from 80.. to a lower number like 40.. to make the cannon fire twice as fast.
/data/execute/fill/kill/particle/playsound/scoreboard/summon/tp
▶Holographic Magnetic Tokamak Fusion ConfinementMachines & MechanismsExpert26 cmds
▶Kinematic Radial Aircraft Engine IgnitionMachines & MechanismsExpert24 cmds
▶Kinematic V8 Engine Piston CutawayMachines & MechanismsExpert24 cmds
▶Automated Smelting FoundryMachines & MechanismsHard24 cmds
▶Critical Meltdown ReactorMachines & MechanismsHard24 cmds
▶Animated V8 Piston Engine CutawayMachines & MechanismsMedium24 cmds