Three glowing defense turrets swivel independently around a central outpost to lock onto approaching monsters and eliminate them with rapid-fire volleys.
Projectiles & MissilesTechnologyIndustrialCyanOrangeBlackMini-gameAdventure MapMap MakingBlock displaysSmooth animation (interpolation)Summoned mobsBlock building (fill/setblock/clone)Rotation math21+ commands
Three glowing defense cannons mounted on sea-lantern pedestals guard a central deepslate outpost. As husks approach from all directions, each turret smoothly turns on its own to track the nearest threat in its sector and fires rapid three-round plasma volleys.
The bolts streak across the platform with glowing orange dust trails, dealing arrow damage on impact and vanishing as soon as they strike a target or time out.
/scoreboard objectives add c9_t dummy/fill ~-3 ~-1 ~-3 ~3 ~-1 ~3 minecraft:deepslate_tiles/fill ~-1 ~-1 ~-1 ~1 ~-1 ~1 minecraft:crying_obsidian/summon minecraft:villager ~ ~ ~ {Tags:["c9_bait"],NoAI:1b,Invulnerable:1b,Silent:1b,PersistenceRequired:1b}/summon minecraft:marker ~ ~ ~ {Tags:["c9_spawner"]}/summon minecraft:block_display ~-7 ~2.35 ~-5 {Tags:["c9_turret"],block_state:{Name:"minecraft:dispenser",Properties:{facing:"south"}},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-0.35f,-0.35f,-0.35f],scale:[0.7f,0.7f,1.4f]},teleport_duration:2,Glowing:1b,glow_color_override:65535,brightness:{sky:15,block:15}}/summon minecraft:block_display ~7 ~2.35 ~-5 {Tags:["c9_turret"],block_state:{Name:"minecraft:dispenser",Properties:{facing:"south"}},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-0.35f,-0.35f,-0.35f],scale:[0.7f,0.7f,1.4f]},teleport_duration:2,Glowing:1b,glow_color_override:65535,brightness:{sky:15,block:15}}/summon minecraft:block_display ~0 ~2.35 ~7 {Tags:["c9_turret"],block_state:{Name:"minecraft:dispenser",Properties:{facing:"south"}},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-0.35f,-0.35f,-0.35f],scale:[0.7f,0.7f,1.4f]},teleport_duration:2,Glowing:1b,glow_color_override:65535,brightness:{sky:15,block:15}}/execute at @e[tag=c9_turret] run fill ~ ~-2 ~ ~ ~-1 ~ minecraft:polished_deepslate/execute at @e[tag=c9_turret] run setblock ~ ~-1 ~ minecraft:sea_lantern/scoreboard players add #c9_t c9_t 1/execute if score #c9_t c9_t matches 12.. run scoreboard players set #c9_t c9_t 0/execute store result score #c9_cnt c9_t if entity @e[tag=c9_target,nbt={DeathTime:0s}]/execute as @e[tag=c9_spawner] at @s run tp @s ~ ~ ~ ~37 ~/execute if score #c9_cnt c9_t matches ..3 if score #c9_t c9_t matches 1..2 at @e[tag=c9_spawner] run summon minecraft:husk ^ ^ ^12 {Tags:["c9_target"]}/execute as @e[tag=c9_turret] at @s if entity @e[tag=c9_target,nbt={DeathTime:0s},distance=..15] facing entity @e[tag=c9_target,nbt={DeathTime:0s},distance=..15,limit=1,sort=nearest] eyes run tp @s ~ ~ ~ ~ ~/execute as @e[tag=c9_turret] at @s if score #c9_t c9_t matches 1..3 if entity @e[tag=c9_target,nbt={DeathTime:0s},distance=..15] run summon minecraft:block_display ^ ^ ^1.1 {Tags:["c9_bolt"],block_state:{Name:"minecraft:shroomlight"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-0.1f,-0.1f,-0.35f],scale:[0.2f,0.2f,0.7f]},teleport_duration:1,Glowing:1b,glow_color_override:16755200,brightness:{sky:15,block:15}}/execute as @e[tag=c9_bolt] unless score @s c9_t matches 1.. at @s facing entity @e[tag=c9_target,nbt={DeathTime:0s},distance=..18,limit=1,sort=nearest] eyes run tp @s ~ ~ ~ ~ ~/scoreboard players add @e[tag=c9_bolt] c9_t 1/execute as @e[tag=c9_bolt] at @s run tp @s ^ ^ ^1.5/execute as @e[tag=c9_bolt] at @s run particle minecraft:dust{color:[1.0,0.65,0.0],scale:1.2} ~ ~ ~ 0.05 0.05 0.05 0 2/execute as @e[tag=c9_bolt] at @s run damage @e[tag=c9_target,nbt={DeathTime:0s},distance=..1.4,limit=1,sort=nearest] 3 minecraft:arrow/execute as @e[tag=c9_bolt] at @s if entity @e[tag=c9_target,nbt={DeathTime:0s},distance=..1.4] run kill @s/kill @e[tag=c9_bolt,scores={c9_t=15..}]setup #6 Spawns each turret head as a glowing cyan block_display using an elongated dispenser facing south (+Z) with teleport_duration:2 so rotation updates interpolate smoothly.loop #4 Rotates the central spawner marker by 37 degrees every tick so approaching husks enter from varied angles around the entire perimeter.loop #6 Makes every turret independently aim at the eyes of the closest living monster (DeathTime:0s) within 15 blocks.loop #7 Fires a 3-round volley during ticks 1 to 3 of each 12-tick cycle by summoning glowing shroomlight bolts just in front of each turret barrel.loop #8 Aims newly summoned bolts toward the nearest target once before their c9_t age score reaches 1, locking their trajectory.loop #12 Deals 3 arrow damage to any living target within 1.4 blocks of a bolt, followed by removing the bolt on impact or after 15 ticks.


Recorded on our own test server: 60 frames at about 9.9 fps. Our image check saw: Three cyan-glowing cannons on sea-lantern pedestals surround a central deepslate outpost with a villager and fire three-round glowing orange bolt volleys with orange dust trails at approaching 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 these sentries to guard your own Survival base instead of running an automated demo, skip the c9_bait villager and c9_spawner marker in setup, omit loop commands 3, 4, and 5, and change tag=c9_target in the remaining loop commands to type=#minecraft:raiders or specific monster types such as type=minecraft:zombie or type=minecraft:skeleton so the turrets automatically target natural night monsters near your home.
/kill @e[tag=c9_turret]/kill @e[tag=c9_bolt]/kill @e[tag=c9_target]/kill @e[tag=c9_bait]/kill @e[tag=c9_spawner]/scoreboard objectives remove c9_t/fill ~-10 ~ ~-10 ~10 ~3 ~10 minecraft:air/fill ~-3 ~-1 ~-3 ~3 ~-1 ~3 minecraft:grass_blockYes. Summon extra block_display entities with the tag c9_turret anywhere within 18 blocks of your defense zone and build pedestals under them; every loop command targets @e[tag=c9_turret] automatically.
The target selectors check nbt={DeathTime:0s}, which immediately ignores monsters as soon as their death animation begins so turrets switch straight to the next live threat.
/damage/execute/fill/kill/particle/scoreboard/setblock/summon/tp
▶Magnetic Rail-Track Javelin AssemblerProjectiles & MissilesExpert22 cmds
▶Steampunk Piston-Hammer Pilebunker GauntletProjectiles & MissilesMedium24 cmds
▶16-Way Automated ArtilleryProjectiles & MissilesHard25 cmds
▶Archimedes Water-Screw Hydro-Vortex CannonProjectiles & MissilesHard24 cmds
▶Automated Defense TurretProjectiles & MissilesMedium22 cmds
▶Heat-Seeking Rocket LauncherProjectiles & MissilesMedium19 cmds