Four swiveling dispenser turrets atop a beacon-lit deepslate bastion automatically track marching undead waves and fire glowing plasma bolts.
Projectiles & MissilesTechnologyDarkCyanBlackWhiteMini-gameAdventure MapMap MakingParticlesBlock displaysSmooth animation (interpolation)Summoned mobsBlock building (fill/setblock/clone)Glowing outlinesRotation math21+ commands
Four glowing dispenser turrets sit on a tiered deepslate and iron bastion around an active beacon core. As waves of husks march in from every angle, each turret smoothly swivels toward the nearest threat and launches cyan sea_lantern plasma bolts.
Every bolt streaks through the air with bright cyan dust trails, damages undead mobs on contact, and clears itself automatically so the battle runs smoothly on its own.
/scoreboard objectives add c9_tick dummy/fill ~-4 ~ ~-4 ~4 ~ ~4 minecraft:deepslate_bricks/fill ~-3 ~1 ~-3 ~3 ~1 ~3 minecraft:polished_deepslate/fill ~-1 ~2 ~-1 ~1 ~2 ~1 minecraft:iron_block/setblock ~ ~3 ~ minecraft:beacon/summon minecraft:iron_golem ~ ~3 ~ {Tags:["c9_bait"],Invulnerable:1b,NoAI:1b,Silent:1b,active_effects:[{id:"minecraft:invisibility",amplifier:0b,duration:-1,show_particles:0b}]}/summon minecraft:block_display ~1.2 ~3.4 ~1.2 {Tags:["c9_turret","c9_t1"],Glowing:1b,teleport_duration:2,block_state:{Name:"minecraft:dispenser",Properties:{facing:"south"}},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.85f,0.85f,0.85f],translation:[-0.425f,-0.425f,-0.425f]}}/summon minecraft:block_display ~-1.2 ~3.4 ~1.2 {Tags:["c9_turret","c9_t2"],Glowing:1b,teleport_duration:2,block_state:{Name:"minecraft:dispenser",Properties:{facing:"south"}},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.85f,0.85f,0.85f],translation:[-0.425f,-0.425f,-0.425f]}}/summon minecraft:block_display ~1.2 ~3.4 ~-1.2 {Tags:["c9_turret","c9_t3"],Glowing:1b,teleport_duration:2,block_state:{Name:"minecraft:dispenser",Properties:{facing:"south"}},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.85f,0.85f,0.85f],translation:[-0.425f,-0.425f,-0.425f]}}/summon minecraft:block_display ~-1.2 ~3.4 ~-1.2 {Tags:["c9_turret","c9_t4"],Glowing:1b,teleport_duration:2,block_state:{Name:"minecraft:dispenser",Properties:{facing:"south"}},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.85f,0.85f,0.85f],translation:[-0.425f,-0.425f,-0.425f]}}/scoreboard players add #g c9_tick 1/execute if score #g c9_tick matches 8.. run scoreboard players set #g c9_tick 0/execute as @e[tag=c9_bait] at @s run tp @s ~ ~ ~ ~37 0/execute store result score #mobs c9_tick if entity @e[tag=c9_mob]/execute if score #g c9_tick matches 0 if score #mobs c9_tick matches ..14 at @e[tag=c9_bait] run summon minecraft:husk ^ ^-3 ^16 {Tags:["c9_mob"],Glowing:1b}/execute as @e[tag=c9_turret] at @s if entity @e[tag=c9_mob,distance=..18] facing entity @e[tag=c9_mob,sort=nearest,limit=1] eyes run tp @s ~ ~ ~ ~ ~/execute if score #g c9_tick matches 0 as @e[tag=c9_turret] at @s if entity @e[tag=c9_mob,distance=..18] run summon minecraft:block_display ^ ^ ^0.6 {Tags:["c9_bolt"],Glowing:1b,teleport_duration:1,block_state:{Name:"minecraft:sea_lantern"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.22f,0.22f,0.85f],translation:[-0.11f,-0.11f,-0.425f]}}/execute as @e[tag=c9_bolt] unless score @s c9_tick matches 1.. at @s facing entity @e[tag=c9_mob,sort=nearest,limit=1] eyes run tp @s ~ ~ ~ ~ ~/scoreboard players add @e[tag=c9_bolt] c9_tick 1/execute as @e[tag=c9_bolt] at @s run tp @s ^ ^ ^1.1/execute as @e[tag=c9_bolt] at @s run particle minecraft:dust{color:[0.2,0.9,1.0],scale:1.1} ~ ~ ~ 0.05 0.05 0.05 0 2/execute as @e[tag=c9_bolt] at @s positioned ~ ~-1 ~ if entity @e[tag=c9_mob,distance=..1.3] run scoreboard players set @s c9_tick 99/execute as @e[tag=c9_bolt] if score @s c9_tick matches 99 at @s run damage @e[tag=c9_mob,sort=nearest,limit=1] 7/kill @e[tag=c9_bolt,scores={c9_tick=22..}]setup #6 Summons an invisible, invulnerable iron golem inside the central beacon so approaching undead always lock onto the center of the battery.setup #7 Spawns one of the four glowing dispenser block displays with teleport_duration set to 2 so its rotation interpolates smoothly as it tracks targets.loop #5 Spawns a new husk every 8 ticks at a rotating 16-block perimeter around the spinning central beacon marker, capped at 15 active mobs.loop #6 Rotates each turret individually toward the eyes of the closest undead mob within 18 blocks.loop #7 Every 8 ticks, each turret with a target in range fires a stretched sea_lantern block display bolt from its muzzle.loop #12 Checks 1 block below each flying bolt for a nearby undead mob and marks hitting bolts with score 99 so they deal damage and get removed.


Recorded on our own test server: 59 frames at about 9.8 fps. Our image check saw: Four glowing dispenser turrets on a tiered deepslate and iron platform around an active beacon rotate and fire glowing cyan projectiles with cyan particle trails at incoming glowing husks.
Commands, video and screenshots: tested and recorded by www.9minecraft.net © 9Minecraft. Sharing a video or screenshot? Please credit www.9minecraft.net.
To use the Sentinel Battery to defend your own survival base instead of running a mob wave demo, leave out loop commands 3, 4, and 5 (index 2, 3, and 4) and replace tag=c9_mob with type=#minecraft:undead in the remaining loop commands so the turrets automatically target natural nighttime zombies, skeletons, and phantoms.
/kill @e[tag=c9_turret]/kill @e[tag=c9_bait]/kill @e[tag=c9_mob]/kill @e[tag=c9_bolt]/fill ~-4 ~ ~-4 ~4 ~3 ~4 minecraft:air/scoreboard objectives remove c9_tickAn invisible, invulnerable iron golem tagged <code>c9_bait</code> sits inside the beacon block at the center, drawing every undead mob toward the bastion walls.
Yes. Lower the reset value in loop command 2 (for example, from 8 to 5) to increase fire rate, or change the <code>7</code> at the end of loop command 13 to adjust bolt damage.
/damage/execute/fill/kill/particle/scoreboard/setblock/summon/tp
▶Automated Turret Defense GauntletProjectiles & MissilesHard24 cmds
▶Automated Wither-Skull SentryProjectiles & MissilesEasy23 cmds
▶Orbital Flame-Targeted Arrow RainProjectiles & MissilesEasy24 cmds
▶Ferris-Wheel Gondola Revolver CannonProjectiles & MissilesExpert24 cmds
▶Magnetic Rail-Track Javelin AssemblerProjectiles & MissilesExpert22 cmds
▶Pachinko-Board Trick-Shot CrossbowProjectiles & MissilesExpert24 cmds