Build an automated sci-fi railgun turret in vanilla Minecraft using block displays, smooth recoil animations, swirling energy particles, and a massive plasma blast.
Lasers & BeamsTechnologySpaceCyanWhitePurpleCinematicMap MakingPvPBlock displaysArmor standsSmooth animation (interpolation)Block building (fill/setblock/clone)21+ commands
This command creation assembles a futuristic sci-fi turret out of block display entities and runs an automated firing sequence against a target dummy across the stage. During the charge phase, swirling cyan and magenta energy particles draw into the glowing core while a beacon-style laser locks onto the target.
When the capacitor reaches maximum charge, the barrel slams backward with smooth display interpolation and unleashes a high-velocity plasma beam that detonates on the target with shockwave rings and flying sparks.
/scoreboard objectives add c9_timer dummy/fill ~-2 ~-1 ~-9 ~2 ~-1 ~-5 polished_deepslate/setblock ~ ~-1 ~-7 sea_lantern/summon block_display ~ ~ ~-7 {Tags:["c9_all","c9_turret"],brightness:{sky:15,block:15},transformation:{translation:[-1.0f,0.0f,-1.0f],scale:[2.0f,1.2f,2.0f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},block_state:{Name:"minecraft:iron_block"}}/summon block_display ~ ~1.2 ~-7 {Tags:["c9_all","c9_barrel"],interpolation_duration:4,brightness:{sky:15,block:15},transformation:{translation:[-0.6f,0.0f,-1.5f],scale:[1.2f,1.0f,3.5f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},block_state:{Name:"minecraft:netherite_block"}}/summon block_display ~ ~1.35 ~-7 {Tags:["c9_all","c9_core"],interpolation_duration:4,brightness:{sky:15,block:15},transformation:{translation:[-0.35f,0.0f,-1.0f],scale:[0.7f,0.7f,4.2f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},block_state:{Name:"minecraft:sea_lantern"}}/summon block_display ~ ~1.7 ~-5 {Tags:["c9_all","c9_beam"],interpolation_duration:2,brightness:{sky:15,block:15},transformation:{translation:[-0.05f,-0.05f,0.0f],scale:[0.1f,0.1f,0.1f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},block_state:{Name:"minecraft:beacon"}}/summon armor_stand ~ ~ ~9 {Tags:["c9_all","c9_target"],NoGravity:1b,Invisible:1b,ArmorItems:[{id:"minecraft:netherite_boots",count:1},{id:"minecraft:netherite_leggings",count:1},{id:"minecraft:netherite_chestplate",count:1},{id:"minecraft:sea_lantern",count:1}]}/scoreboard players set #tick c9_timer 0/scoreboard players add #tick c9_timer 1/execute if score #tick c9_timer matches 100.. run scoreboard players set #tick c9_timer 0/execute if score #tick c9_timer matches 1..40 run particle dust_color_transition{from_color:[0.0,0.8,1.0],to_color:[1.0,0.0,1.0],scale:1.6} ~ ~1.7 ~-4.5 1.2 1.2 1.2 0 12 force/execute if score #tick c9_timer matches 20..58 run particle electric_spark ~ ~1.7 ~-4.5 0.4 0.4 0.4 0.8 15 force/execute if score #tick c9_timer matches 35..58 run particle sculk_charge_pop ~ ~1.7 ~-4.5 0.2 0.2 0.2 0.05 10 force/execute if score #tick c9_timer matches 35 as @e[tag=c9_core] run data merge entity @s {start_interpolation:0,interpolation_duration:20,transformation:{translation:[-0.45f,-0.1f,-1.0f],scale:[0.9f,0.9f,4.4f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}/execute if score #tick c9_timer matches 55 as @e[tag=c9_beam] run data merge entity @s {start_interpolation:0,interpolation_duration:2,transformation:{translation:[-0.08f,-0.08f,0.0f],scale:[0.16f,0.16f,14.0f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}/execute if score #tick c9_timer matches 60 as @e[tag=c9_barrel] run data merge entity @s {start_interpolation:0,interpolation_duration:2,transformation:{translation:[-0.6f,0.0f,-2.7f],scale:[1.2f,1.0f,3.5f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}/execute if score #tick c9_timer matches 60 as @e[tag=c9_core] run data merge entity @s {start_interpolation:0,interpolation_duration:2,transformation:{translation:[-0.55f,-0.2f,-2.2f],scale:[1.1f,1.1f,4.2f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}/execute if score #tick c9_timer matches 60 as @e[tag=c9_beam] run data merge entity @s {start_interpolation:0,interpolation_duration:2,transformation:{translation:[-0.45f,-0.45f,0.0f],scale:[0.9f,0.9f,14.5f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}/execute if score #tick c9_timer matches 60..66 run particle sonic_boom ~ ~1.7 ~-3 0 0 3.5 1 5 force/execute if score #tick c9_timer matches 60..68 run particle end_rod ~ ~1.5 ~9 0.6 0.6 0.6 0.6 40 force/execute if score #tick c9_timer matches 61 run particle explosion_emitter ~ ~1.5 ~9 0 0 0 0 1 force/execute if score #tick c9_timer matches 75 as @e[tag=c9_barrel] run data merge entity @s {start_interpolation:0,interpolation_duration:18,transformation:{translation:[-0.6f,0.0f,-1.5f],scale:[1.2f,1.0f,3.5f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}/execute if score #tick c9_timer matches 75 as @e[tag=c9_beam] run data merge entity @s {start_interpolation:0,interpolation_duration:8,transformation:{translation:[-0.05f,-0.05f,0.0f],scale:[0.1f,0.1f,0.1f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}setup #5 Summons the main netherite cannon barrel using a <code>block_display</code> stretched to 3.5 blocks long with full brightness so it stays visible at night.setup #7 Summons a tiny hidden beacon <code>block_display</code> at the tip of the muzzle that will later stretch 14.5 blocks forward to become the solid plasma beam.loop #8 At tick 60 (firing moment), slides the barrel display backward by 1.2 blocks over 2 ticks using display interpolation to create realistic heavy recoil.loop #10 Simultaneously scales the beacon display entity into a 0.9x0.9x14.5 glowing plasma beam connecting the turret muzzle to the target.loop #14 At tick 75, smoothly slides the barrel back to its resting position over 18 ticks while the beam shrinks away.


Recorded on our own test server: 50 frames at about 9.8 fps. Our image check saw: A futuristic white and cyan turret charges up with swirling blue and purple particles before firing a glowing cyan laser beam surrounded by sonic boom rings.
Commands, video and screenshots: tested and recorded by www.9minecraft.net © 9Minecraft. Sharing a video or screenshot? Please credit www.9minecraft.net.
To let a player trigger the cannon on demand instead of firing on an automatic loop, remove the first two loop commands and only increment #tick c9_timer when a player holds or clicks a custom controller item or presses a button connected to an impulse command block that sets #tick c9_timer to 1.
/kill @e[tag=c9_all]/fill ~-2 ~-1 ~-9 ~2 ~-1 ~-5 grass_block/scoreboard objectives remove c9_timerIt uses a single block_display entity with start_interpolation and interpolation_duration, which tells the Minecraft client to smoothly animate scale and position changes between ticks.
Yes! Lower or raise the reset threshold in the second loop command (currently 100 ticks, or 5 seconds) to make the cannon fire faster or slower.
▶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