Build an automated laser sentry turret in vanilla Minecraft using display entities and command blocks that tracks husks and fires rapid red laser beams.
Lasers & BeamsTechnologyIndustrialFireRedCyanBlackPvPMap MakingMini-gameBlock displaysArmor standsSmooth animation (interpolation)Summoned mobsBlock building (fill/setblock/clone)Glowing outlinesRotation math21+ commands
This command creation constructs an automated defense turret on a fortified blackstone and sea lantern pedestal. Built from scaled block display entities, the turret features an iron chassis, a glowing cyan energy core, and dual redstone laser barrels that swivel smoothly to lock onto nearby threats.
As wandering husks spawn around the perimeter, the sentry automatically rotates toward the closest target, charges its cyan energy core with bright particles, and fires continuous red laser beams that damage and incinerate intruders on impact.
/scoreboard objectives add c9_timer dummy/fill ~-1 ~ ~-1 ~1 ~ ~1 polished_blackstone_brick_slab[type=bottom]/setblock ~ ~ ~ chiseled_polished_blackstone/setblock ~ ~1 ~ sea_lantern/setblock ~ ~2 ~ hopper[facing=down]/summon armor_stand ~ ~2.8 ~ {Tags:["c9_entity","c9_turret"],NoGravity:1b,Invisible:1b,Marker:1b}/summon block_display ~ ~2.8 ~ {Tags:["c9_entity","c9_part","c9_head"],Glowing:1b,glow_color_override:65535,brightness:{sky:15,block:15},teleport_duration:2,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[1.2f,1.0f,1.5f],translation:[-0.6f,-0.5f,-0.75f]},block_state:{Name:"minecraft:iron_block"}}/summon block_display ~ ~2.8 ~ {Tags:["c9_entity","c9_part","c9_core"],Glowing:1b,glow_color_override:65535,brightness:{sky:15,block:15},teleport_duration:2,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[1.4f,0.6f,0.9f],translation:[-0.7f,-0.3f,-0.45f]},block_state:{Name:"minecraft:diamond_block"}}/summon block_display ~ ~2.8 ~ {Tags:["c9_entity","c9_part","c9_barrel"],Glowing:1b,glow_color_override:16711680,brightness:{sky:15,block:15},teleport_duration:2,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.35f,0.35f,2.2f],translation:[-0.175f,-0.175f,0.2f]},block_state:{Name:"minecraft:redstone_block"}}/summon husk ~4 ~ ~4 {Tags:["c9_entity","c9_mob"],Glowing:1b}/scoreboard players add #tick c9_timer 1/execute if score #tick c9_timer matches 40.. run scoreboard players set #tick c9_timer 0/execute if score #tick c9_timer matches 1 unless entity @e[tag=c9_mob,distance=..15] run summon husk ~4 ~ ~4 {Tags:["c9_entity","c9_mob"],Glowing:1b}/execute if score #tick c9_timer matches 14 unless entity @e[tag=c9_mob,distance=..15] run summon husk ~-4 ~ ~3 {Tags:["c9_entity","c9_mob"],Glowing:1b}/execute if score #tick c9_timer matches 27 unless entity @e[tag=c9_mob,distance=..15] run summon husk ~3 ~ ~-4 {Tags:["c9_entity","c9_mob"],Glowing:1b}/execute as @e[tag=c9_turret] at @s if entity @e[tag=c9_mob,distance=..15] run tp @s ~ ~ ~ facing entity @e[tag=c9_mob,distance=..15,sort=nearest,limit=1] eyes/execute as @e[tag=c9_turret] at @s unless entity @e[tag=c9_mob,distance=..15] run tp @s ~ ~ ~ ~6 ~/execute as @e[tag=c9_part] at @s run tp @s @e[tag=c9_turret,limit=1]/execute at @e[tag=c9_turret] run particle dust{color:[0.0,1.0,1.0],scale:2.0} ~ ~0.2 ~ 0.6 0.4 0.6 0 4 force/execute at @e[tag=c9_turret] if entity @e[tag=c9_mob,distance=..15] run particle dust{color:[1.0,0.0,0.0],scale:2.2} ^ ^ ^1.5 0.05 0.05 0.05 0 5 force/execute at @e[tag=c9_turret] if entity @e[tag=c9_mob,distance=..15] run particle dust{color:[1.0,0.1,0.0],scale:2.0} ^ ^ ^3.0 0.05 0.05 0.05 0 5 force/execute at @e[tag=c9_turret] if entity @e[tag=c9_mob,distance=..15] run particle dust{color:[1.0,0.2,0.0],scale:2.0} ^ ^ ^4.5 0.05 0.05 0.05 0 5 force/execute at @e[tag=c9_turret] as @e[tag=c9_mob,distance=..15,sort=nearest,limit=1] at @s run particle flame ~ ~1 ~ 0.3 0.5 0.3 0.05 6 force/execute if score #tick c9_timer matches 10 at @e[tag=c9_turret] as @e[tag=c9_mob,distance=..15,sort=nearest,limit=1] at @s run damage @s 6 minecraft:magicsetup #6 Summons an invisible marker armor stand named <code>c9_turret</code> above the pedestal to act as the rotational pivot and aiming controller for the sentry.setup #7 Creates the main iron turret body using a <code>block_display</code> entity with <code>teleport_duration:2</code> for smooth rotation interpolation and a cyan glow outline.loop #6 Rotates the turret controller armor stand to face the eyes of the nearest <code>c9_mob</code> within a 15-block radius.loop #8 Teleports all 3D display parts (<code>c9_part</code>) to match the exact position and facing angle of the <code>c9_turret</code> pivot.loop #10 Projects bright red laser dust particles forward along the turret's line of sight using local coordinates (<code>^ ^ ^1.5</code> to <code>^ ^ ^4.5</code>) whenever a target is locked.loop #14 Deals 6 points of magic damage to the targeted husk every cycle while enveloping it in flame particles.


Recorded on our own test server: 50 frames at about 8.3 fps. Our image check saw: A sea lantern and blackstone pedestal topped with cyan particles shoots red particle lasers at glowing husks, setting them on fire, though the scaled block display turret chassis is not clearly visible.
Commands, video and screenshots: tested and recorded by www.9minecraft.net © 9Minecraft. Sharing a video or screenshot? Please credit www.9minecraft.net.
To make the turret defend you against all hostile monsters in your survival base instead of just demo husks, replace tag=c9_mob in the loop commands with type=#minecraft:raiders or type=zombie, and remove the three husk summoning commands from the loop.
/kill @e[tag=c9_entity]/fill ~-1 ~ ~-1 ~1 ~2 ~1 air/scoreboard objectives remove c9_timerMarker entities do not store or update rotation when teleported with facing in some server configurations. Using an invisible Marker Armor Stand ensures reliable yaw and pitch tracking for the block displays.
Yes! Edit the RGB array inside <code>dust{color:[1.0,0.0,0.0],scale:2.2}</code> in the loop commands to any RGB decimal values between 0.0 and 1.0.
▶Autonomous Defense TurretLasers & BeamsMedium24 cmds
▶Orbital Death LaserLasers & BeamsMedium22 cmds
▶Orbital Starter-Base ObliteratorLasers & BeamsMedium21 cmds
▶Planetary Defense Plasma CannonLasers & BeamsHard24 cmds
▶Tactical Terrain VaporizerLasers & BeamsMedium24 cmds
▶Track-Mounted Auto-TurretLasers & BeamsMedium24 cmds