Autonomous Laser Sentry Turret

Build an automated laser sentry turret in vanilla Minecraft using display entities and command blocks that tracks husks and fires rapid red laser beams.

Java EditionWands, Weapons & ToolsMedium24 commandsTested on a real 26.2 & 26.3 server
A glowing turret pedestal fires red laser particles at burning husks in Minecraft at night. Download the GIF Video & GIF © www.9minecraft.net

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.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9_timer dummy
  2. /fill ~-1 ~ ~-1 ~1 ~ ~1 polished_blackstone_brick_slab[type=bottom]
  3. /setblock ~ ~ ~ chiseled_polished_blackstone
  4. /setblock ~ ~1 ~ sea_lantern
  5. /setblock ~ ~2 ~ hopper[facing=down]
  6. /summon armor_stand ~ ~2.8 ~ {Tags:["c9_entity","c9_turret"],NoGravity:1b,Invisible:1b,Marker:1b}
  7. /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"}}
  8. /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"}}
  9. /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"}}
  10. /summon husk ~4 ~ ~4 {Tags:["c9_entity","c9_mob"],Glowing:1b}

2. Loop - one repeating command block each (Always Active) 14 commands

  1. /scoreboard players add #tick c9_timer 1
  2. /execute if score #tick c9_timer matches 40.. run scoreboard players set #tick c9_timer 0
  3. /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}
  4. /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}
  5. /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}
  6. /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
  7. /execute as @e[tag=c9_turret] at @s unless entity @e[tag=c9_mob,distance=..15] run tp @s ~ ~ ~ ~6 ~
  8. /execute as @e[tag=c9_part] at @s run tp @s @e[tag=c9_turret,limit=1]
  9. /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
  10. /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
  11. /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
  12. /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
  13. /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
  14. /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:magic

How it works

Frames from the test run

Autonomous Laser Sentry Turret - frame 1Autonomous Laser Sentry Turret - frame 2Autonomous Laser Sentry Turret - frame 3

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.

Build it in your world

  1. Stand on a flat open area where you want the sentry turret pedestal to be built.
  2. Run each of the 10 Setup commands once in chat or via impulse command blocks placed at the center.
  3. Place a line of 14 Repeating Command Blocks (or 1 Repeating followed by 13 Chain Command Blocks), all set to Always Active.
  4. Paste each of the 14 Loop commands into the command blocks in order.
  5. Watch the turret automatically scan the area, lock onto incoming husks, and fire its red laser beam.

Use it with real players

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.

Remove it again 3 commands

  1. /kill @e[tag=c9_entity]
  2. /fill ~-1 ~ ~-1 ~1 ~2 ~1 air
  3. /scoreboard objectives remove c9_timer

FAQ

Why wasn't the turret rotating in older setups?

Marker 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.

Can I change the color of the laser beam?

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.

Commands used

/damage/execute/fill/particle/scoreboard/setblock/summon/tp

Similar creations

Join 9Minecraft News & Guides