Build an automated sci-fi artillery cannon using display entities and particle rays that charges emerald energy and blasts a regenerating bunker.
Lasers & BeamsTechnologySpaceIndustrialGreenBlackWhiteCinematicMap MakingDecorationParticlesBlock displaysScoreboard timersExecute chainsSummoned mobsBlock building (fill/setblock/clone)Rotation math21+ commands
The Planetary Defense Plasma Cannon is an automated sci-fi artillery display built using display entities, dynamic particle vectors, and block manipulation. The heavy cannon base features an angled barrel with glowing emerald conduits and a spinning magnetic containment ring at the muzzle.
During each firing cycle, a target bunker regenerates downrange while green plasma gathers at the barrel tip. Once fully charged, the cannon fires a high-velocity energy beam across the stage that shatters the bunker on impact before resetting for the next shot.
/scoreboard objectives add c9_timer dummy/fill ~-3 ~ ~7 ~3 ~ ~13 minecraft:polished_deepslate/fill ~-2 ~1 ~8 ~2 ~2 ~12 minecraft:iron_block/fill ~-1 ~1 ~7 ~1 ~3 ~11 minecraft:obsidian/setblock ~-2 ~2 ~10 minecraft:emerald_block/setblock ~2 ~2 ~10 minecraft:emerald_block/setblock ~ ~3 ~10 minecraft:sea_lantern/summon minecraft:block_display ~ ~2.5 ~9 {Tags:["c9_ent","c9_barrel"],Rotation:[180f,-22f],transformation:{translation:[-0.6f,-0.6f,0f],scale:[1.2f,1.2f,7.5f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},block_state:{Name:"minecraft:polished_blackstone"}}/summon minecraft:block_display ~ ~2.5 ~9 {Tags:["c9_ent","c9_core"],Rotation:[180f,-22f],transformation:{translation:[-0.35f,-0.35f,0.5f],scale:[0.7f,0.7f,7.2f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},block_state:{Name:"minecraft:emerald_block"},brightness:{sky:15,block:15}}/summon minecraft:block_display ~ ~5.3 ~2.0 {Tags:["c9_ent","c9_muzzle"],Rotation:[180f,-22f],transformation:{translation:[-0.85f,-0.85f,-0.4f],scale:[1.7f,1.7f,0.8f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},block_state:{Name:"minecraft:sea_lantern"},brightness:{sky:15,block:15}}/scoreboard players add #tick c9_timer 1/execute if score #tick c9_timer matches 140.. run scoreboard players set #tick c9_timer 1/execute as @e[tag=c9_muzzle] at @s run tp @s ~ ~ ~ ~12 ~/execute if score #tick c9_timer matches 1 run fill ~-2 ~ ~-12 ~2 ~6 ~-8 minecraft:quartz_bricks replace/execute if score #tick c9_timer matches 1 run fill ~-1 ~2 ~-12 ~1 ~4 ~-8 minecraft:tinted_glass/execute if score #tick c9_timer matches 1 run setblock ~ ~3 ~-10 minecraft:redstone_block/execute if score #tick c9_timer matches 20..80 run particle minecraft:dust{color:[0.1,1.0,0.2],scale:2.2} ~ ~5.3 ~2.0 1.5 1.5 1.5 0 15 force/execute if score #tick c9_timer matches 20..80 run particle minecraft:totem_of_undying ~ ~5.3 ~2.0 0.6 0.6 0.6 0.15 6 force/execute if score #tick c9_timer matches 80 run summon minecraft:marker ~ ~5.3 ~2.0 {Tags:["c9_ent","c9_ray"],Rotation:[180f,11f]}/execute as @e[tag=c9_ray] at @s run tp @s ^ ^ ^1.5/execute as @e[tag=c9_ray] at @s run particle minecraft:dust_color_transition{from_color:[0.2,1.0,0.3],to_color:[0.8,1.0,0.9],scale:3.5} ~ ~ ~ 0.25 0.25 0.25 0 25 force/execute as @e[tag=c9_ray] at @s if block ~ ~ ~ minecraft:redstone_block run particle minecraft:explosion_emitter ~ ~ ~ 1 1 1 0 3 force/execute as @e[tag=c9_ray] at @s if block ~ ~ ~ minecraft:redstone_block run fill ~-2 ~-2 ~-2 ~2 ~2 ~2 minecraft:air destroy/execute if score #tick c9_timer matches 95.. run kill @e[tag=c9_ray]setup #8 Summons the main angled cannon barrel using a scaled <code>block_display</code> entity tilted upward at a 22-degree pitch.loop #3 Continuously rotates the sea lantern muzzle ring around its local axis every tick to create a spinning magnetic containment effect.loop #9 At tick 80, summons an invisible marker entity at the muzzle aimed directly downrange toward the target bunker's redstone core.loop #10 Advances the plasma ray marker forward by 1.5 blocks per tick along its local facing vector using caret coordinates (<code>^ ^ ^1.5</code>).loop #13 Detects when the ray marker reaches the redstone core block inside the bunker and blasts a 5x5x5 cavity using <code>fill ... destroy</code> for block shatter particles.


Recorded on our own test server: 54 frames at about 8.9 fps. Our image check saw: An obsidian and iron cannon with emerald blocks charges green particles at its barrel tip while a grey target bunker appears in the background.
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 cannon manually instead of on an automatic loop, remove the first two timer commands and trigger the charge sequence when a player holds a custom controller item using /execute if entity @a[nbt={SelectedItem:{id:"minecraft:emerald"}}] run scoreboard players add #tick c9_timer 1. You can also aim the ray along the player's view angle by copying the player's rotation to the ray marker when it spawns.
/kill @e[tag=c9_ent]/kill @e[type=item]/fill ~-4 ~ ~-14 ~4 ~10 ~14 minecraft:air/scoreboard objectives remove c9_timerBoth the setup and loop commands use relative coordinates centered on the stage. Make sure all loop commands are executed from the exact same center position where you ran the setup commands.
Yes! Edit the RGB float values inside the dust and dust_color_transition particle commands in the loop (for example, change [0.1,1.0,0.2] to [0.1,0.5,1.0] for a blue ion cannon).
▶Automated Sentinel TurretLasers & BeamsMedium24 cmds
▶DNA Helix Biotic Disintegrator RifleLasers & BeamsHard19 cmds
▶Futuristic Plasma CannonLasers & BeamsMedium24 cmds
▶Orbital Death LaserLasers & BeamsMedium22 cmds
▶Orbital Starter-Base ObliteratorLasers & BeamsMedium21 cmds
▶Orbital Strike Laser BeamLasers & BeamsMedium21 cmds