Automated Homing Missile Sentry

Build an automated defense turret in Minecraft Java Edition that tracks moving targets and launches smoke-trailing homing rockets that detonate on impact.

Java EditionWands, Weapons & ToolsHard21 commandsTested on a real 26.2 & 26.3 server
An automated turret fires flaming projectiles with smoke trails toward a glowing armor stand target at night. Download the GIF Video & GIF © www.9minecraft.net

Projectiles & MissilesTechnologyIndustrialFireOrangeWhiteBlackPvPAdventure MapMap MakingBlock displaysItem displaysArmor standsFireworksBlock building (fill/setblock/clone)SoundsRotation math21+ commands

The Automated Homing Missile Sentry is a self-operating defense turret built with display entities and scoreboard timers. Placed at the center of your base, its glowing head swivels continuously to lock onto nearby threats and launches custom rockets that arc through the air.

In this self-running demo, a glowing target dummy orbits the platform while the turret tracks its movement. Every two seconds, the sentry fires a heat-seeking missile trailed by campfire smoke and bright sparks, culminating in a burst of lava and explosive particles when it hits the mark.

1. Setup - type these once 7 commands

  1. /scoreboard objectives add c9_timer dummy
  2. /fill ~-1 ~ ~-1 ~1 ~ ~1 polished_deepslate_slab[type=bottom]
  3. /setblock ~ ~ ~ lodestone
  4. /setblock ~ ~1 ~ hopper[facing=down]
  5. /summon block_display ~ ~2 ~ {Tags:["c9_all","c9_turret"],Glowing:1b,glow_color_override:65535,block_state:{Name:"minecraft:DISPENSER",Properties:{facing:"north"}},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.9f,0.9f,0.9f],translation:[-0.45f,-0.45f,-0.45f]}}
  6. /summon armor_stand ~ ~ ~-10 {Tags:["c9_all","c9_orbit"],Invisible:1b,NoGravity:1b,Marker:1b}
  7. /summon armor_stand ~ ~1 ~-10 {Tags:["c9_all","c9_target"],NoGravity:1b,Glowing:1b,CustomName:'{"text":"Target Dummy","color":"red"}',CustomNameVisible:1b,equipment:{head:{id:"minecraft:target",count:1},chest:{id:"minecraft:NETHERITE_CHESTPLATE",count:1}}}

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

  1. /scoreboard players add #main c9_timer 1
  2. /execute as @e[tag=c9_orbit] at @s facing ~ ~ ~ run tp @s ^-0.45 ^ ^-0.01 facing ~ ~ ~
  3. /execute at @e[tag=c9_orbit] run tp @e[tag=c9_target,limit=1] ~ ~1 ~
  4. /execute as @e[tag=c9_turret] at @s facing entity @e[tag=c9_target,limit=1] eyes run tp @s ~ ~ ~ ~ ~
  5. /execute at @e[tag=c9_turret] anchored eyes run particle dust{color:[1.0,0.1,0.1],scale:0.6} ^ ^ ^1.2 0 0 0 0 1 force
  6. /execute if score #main c9_timer matches 40.. at @e[tag=c9_turret] run summon item_display ~ ~0.6 ~ {Tags:["c9_all","c9_missile"],Glowing:1b,glow_color_override:16744192,item:{id:"minecraft:FIREWORK_ROCKET",count:1},transformation:{left_rotation:[0.707f,0f,0f,0.707f],right_rotation:[0f,0f,0f,1f],scale:[1.4f,1.4f,1.4f],translation:[0f,0f,0f]}}
  7. /execute if score #main c9_timer matches 40.. at @e[tag=c9_turret] run playsound entity.firework_rocket.launch master @a ~ ~ ~ 2 0.7
  8. /execute if score #main c9_timer matches 40.. run scoreboard players set #main c9_timer 0
  9. /execute as @e[tag=c9_missile] at @s facing entity @e[tag=c9_target,limit=1] eyes run tp @s ^ ^ ^0.65 ~ ~
  10. /execute as @e[tag=c9_missile] at @s run particle campfire_cosy_smoke ~ ~ ~ 0.05 0.05 0.05 0.01 2 force
  11. /execute as @e[tag=c9_missile] at @s run particle flame ~ ~ ~ 0.05 0.05 0.05 0.02 4 force
  12. /execute as @e[tag=c9_missile] at @s if entity @e[tag=c9_target,distance=..1.5] run particle explosion_emitter ~ ~ ~ 0 0 0 1 1 force
  13. /execute as @e[tag=c9_missile] at @s if entity @e[tag=c9_target,distance=..1.5] run playsound entity.generic.explode master @a ~ ~ ~ 1.5 1.2
  14. /execute as @e[tag=c9_missile] at @s if entity @e[tag=c9_target,distance=..1.5] run kill @s

How it works

Frames from the test run

Automated Homing Missile Sentry - frame 1Automated Homing Missile Sentry - frame 2Automated Homing Missile Sentry - frame 3

Recorded on our own test server: 50 frames at about 9.8 fps. Our image check saw: A small turret on a dark stone base fires projectiles leaving trails of fire and smoke particles toward a glowing white armor stand target in the distance at night.

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 at the center of a flat open area where you want your sentry turret and run the 7 setup commands in chat one by one.
  2. Place a chain of 14 command blocks nearby. Set the first one to Repeat and Always Active, and chain the remaining 13 to it (Chain, Unconditional, Always Active) or place them in 14 separate Repeating Always Active blocks.
  3. If your command blocks are not at the exact center of the turret, wrap the coordinate-based loop commands with execute positioned X Y Z run ... using the turret base coordinates.
  4. Paste each of the 14 loop commands into the repeating command blocks in order.
  5. Watch the turret lock onto the circling target dummy and fire homing rockets every two seconds.
  6. When you are finished, turn off the repeating command blocks and run the remove commands to clean up the entities and blocks.

Use it with real players

To make the sentry target survival players or hostile mobs instead of the demo dummy, replace every instance of @e[tag=c9_target,limit=1] and @e[tag=c9_target,distance=..1.5] in the loop commands with @e[type=#minecraft:raiders,limit=1,sort=nearest,distance=..24] for mobs or @a[gamemode=survival,limit=1,sort=nearest,distance=..24] for players, and add a /damage command right before the missile kills itself.

Remove it again 3 commands

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

FAQ

Why does the dispenser turret head rotate smoothly at any angle instead of snapping to the block grid?

The turret head is a block_display entity rather than a solid block. By shifting its translation by minus half of its scale (-0.45), its pivot point is centered inside the entity, allowing smooth 360-degree pitch and yaw rotation.

Will the missiles lag the server if the target disappears?

In the demo, the target dummy never leaves the stage so every rocket hits within two seconds. If you adapt this for real mobs that might die early, add a lifetime scoreboard timer to each missile and kill any missile that stays alive longer than 100 ticks.

Commands used

/execute/fill/kill/particle/playsound/scoreboard/setblock/summon/tp

Similar creations

Join 9Minecraft News & Guides