Automated Arrow Defense Tower

Build an automated medieval defense tower in vanilla Minecraft with a rotating crossbow turret, glowing perimeter ring, laser sight, and homing arrows.

Java EditionWands, Weapons & ToolsMedium24 commandsTested on a real 26.2 & 26.3 server
A stone brick defense tower topped with a glowing crossbow targets incoming outlined zombies. Download the GIF Video & GIF © www.9minecraft.net

Projectiles & MissilesMedievalFireOrangeCyanWhitePvPAdventure MapMap MakingParticlesItem displaysScoreboard timersExecute chainsSummoned mobsBlock building (fill/setblock/clone)Glowing outlinesRotation math21+ commands

Protect your base automatically with this medieval arrow defense tower built using only vanilla commands. A stone brick watchtower stands at the center of a glowing cyan perimeter ring while an oversized glowing crossbow turret rotates on the roof, projecting a red targeting laser across the battlefield.

Whenever invading monsters cross into the defense perimeter, the turret locks onto the nearest threat and fires homing arrows that track targets down and detonate in bursts of flame.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9_timer dummy
  2. /fill ~-1 ~ ~-1 ~1 ~3 ~1 stone_bricks
  3. /fill ~-1 ~ ~-1 ~1 ~1 ~1 cobblestone
  4. /fill ~-2 ~4 ~-2 ~2 ~4 ~2 stone_brick_slab[type=top]
  5. /fill ~-2 ~5 ~-2 ~2 ~5 ~2 stone_brick_wall
  6. /fill ~-1 ~5 ~-1 ~1 ~5 ~1 air
  7. /setblock ~ ~4 ~ lodestone
  8. /summon item_display ~ ~5.9 ~ {Tags:["c9_turret"],Glowing:1b,glow_color_override:16755200,item:{id:"minecraft:crossbow",count:1,components:{"minecraft:charged_projectiles":[{id:"minecraft:arrow",count:1}]}},transformation:{left_rotation:[0.707f,0f,0f,0.707f],right_rotation:[0f,0f,0.707f,0.707f],translation:[0f,0f,0f],scale:[2.6f,2.6f,2.6f]}}
  9. /summon marker ~ ~ ~ {Tags:["c9_ctrl"]}
  10. /summon husk ~8 ~ ~4 {Tags:["c9_mob"],CustomName:{"text":"Invader","color":"red"},Glowing:1b,equipment:{head:{id:"minecraft:iron_helmet",count:1}}}

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

  1. /scoreboard players add @e[tag=c9_ctrl] c9_timer 1
  2. /execute if score @e[tag=c9_ctrl,limit=1] c9_timer matches 40.. run scoreboard players set @e[tag=c9_ctrl] c9_timer 0
  3. /execute as @e[tag=c9_ctrl] at @s run tp @s ~ ~ ~ ~15 ~
  4. /execute at @e[tag=c9_ctrl] run particle dust{color:[0.1,0.9,1.0],scale:1.8} ^ ^0.2 ^11 0.2 0.1 0.2 0 4 force
  5. /execute at @e[tag=c9_ctrl] run particle dust{color:[0.1,0.9,1.0],scale:1.8} ^ ^0.2 ^-11 0.2 0.1 0.2 0 4 force
  6. /execute if score @e[tag=c9_ctrl,limit=1] c9_timer matches 5 unless entity @e[tag=c9_mob,distance=..18] run summon husk ~9 ~ ~5 {Tags:["c9_mob"],CustomName:{"text":"Invader","color":"red"},Glowing:1b,equipment:{head:{id:"minecraft:iron_helmet",count:1}}}
  7. /execute if score @e[tag=c9_ctrl,limit=1] c9_timer matches 20 run summon husk ~-8 ~ ~7 {Tags:["c9_mob"],CustomName:{"text":"Invader","color":"red"},Glowing:1b,equipment:{head:{id:"minecraft:chainmail_helmet",count:1}}}
  8. /execute if score @e[tag=c9_ctrl,limit=1] c9_timer matches 35 run summon husk ~7 ~ ~-8 {Tags:["c9_mob"],CustomName:{"text":"Invader","color":"red"},Glowing:1b,equipment:{head:{id:"minecraft:golden_helmet",count:1}}}
  9. /execute as @e[tag=c9_mob] at @s facing ~ ~ ~ run tp @s ^ ^ ^0.1 ~ ~
  10. /execute as @e[tag=c9_turret] at @s facing entity @e[tag=c9_mob,sort=nearest,limit=1] eyes run tp @s ~ ~ ~ ~ ~
  11. /execute at @e[tag=c9_turret] if entity @e[tag=c9_mob,distance=..16] run particle dust{color:[1.0,0.1,0.1],scale:1.2} ^ ^ ^2.2 0 0 0 0 1 force
  12. /execute at @e[tag=c9_turret] if score @e[tag=c9_ctrl,limit=1] c9_timer matches 12 if entity @e[tag=c9_mob,distance=..16] run summon arrow ^ ^ ^0.8 {Tags:["c9_arrow"],Crit:1b,Glowing:1b,damage:6.0d}
  13. /execute as @e[tag=c9_arrow] at @s facing entity @e[tag=c9_mob,sort=nearest,limit=1] eyes run tp @s ^ ^ ^1.2 ~ ~
  14. /execute as @e[tag=c9_arrow] at @s if entity @e[tag=c9_mob,distance=..2.2] run particle flame ~ ~0.5 ~ 0.3 0.3 0.3 0.08 16 force

How it works

Frames from the test run

Automated Arrow Defense Tower - frame 1Automated Arrow Defense Tower - frame 2Automated Arrow Defense Tower - frame 3

Recorded on our own test server: 59 frames at about 9.7 fps. Our image check saw: A stone brick tower with a giant glowing orange-outlined crossbow on top is surrounded by a faint blue particle ring, fire particles, and glowing white-outlined zombies.

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. Choose a flat 41x41 area in your world and stand at the exact center block where you want the defense tower built.
  2. Run each of the 10 setup commands once in chat or from impulse command blocks to construct the stone tower, summon the crossbow turret, and create the timer objective.
  3. Place 14 repeating command blocks set to Always Active near the center (or run them using <code>execute positioned</code> at the tower center).
  4. Paste one loop command into each repeating command block in the listed order.
  5. Watch the cyan perimeter ring spin up around the tower while the turret locks onto incoming invaders and fires homing arrows.

Use it with real players

To use this tower for real survival base defense instead of the automated demo, remove loop commands 6, 7, 8, and 9 (which spawn and march the demo c9_mob husks). Then replace every selector @e[tag=c9_mob,...] in the remaining turret and arrow commands with @e[type=#minecraft:raiders,distance=..16] or @e[type=zombie,distance=..16] so the turret targets natural hostile mobs that approach your base.

Remove it again 6 commands

  1. /kill @e[tag=c9_turret]
  2. /kill @e[tag=c9_ctrl]
  3. /kill @e[tag=c9_mob]
  4. /kill @e[tag=c9_arrow]
  5. /fill ~-2 ~ ~-2 ~2 ~6 ~2 air
  6. /scoreboard objectives remove c9_timer

FAQ

Why did the loop commands not work when pasted earlier?

Make sure there is no space between the leading slash and the command name (use /scoreboard rather than / scoreboard), as even a single space stops the timer from counting.

Can I increase the range of the perimeter ring and turret?

Yes! Increase the ^11 and ^-11 offsets in loop commands 4 and 5 to widen the cyan particle ring, and raise distance=..16 in the turret commands to match your new radius.

Commands used

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

Similar creations

Join 9Minecraft News & Guides