Build an automated medieval defense tower in vanilla Minecraft with a rotating crossbow turret, glowing perimeter ring, laser sight, and homing arrows.
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.
/scoreboard objectives add c9_timer dummy/fill ~-1 ~ ~-1 ~1 ~3 ~1 stone_bricks/fill ~-1 ~ ~-1 ~1 ~1 ~1 cobblestone/fill ~-2 ~4 ~-2 ~2 ~4 ~2 stone_brick_slab[type=top]/fill ~-2 ~5 ~-2 ~2 ~5 ~2 stone_brick_wall/fill ~-1 ~5 ~-1 ~1 ~5 ~1 air/setblock ~ ~4 ~ lodestone/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]}}/summon marker ~ ~ ~ {Tags:["c9_ctrl"]}/summon husk ~8 ~ ~4 {Tags:["c9_mob"],CustomName:{"text":"Invader","color":"red"},Glowing:1b,equipment:{head:{id:"minecraft:iron_helmet",count:1}}}/scoreboard players add @e[tag=c9_ctrl] c9_timer 1/execute if score @e[tag=c9_ctrl,limit=1] c9_timer matches 40.. run scoreboard players set @e[tag=c9_ctrl] c9_timer 0/execute as @e[tag=c9_ctrl] at @s run tp @s ~ ~ ~ ~15 ~/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/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/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}}}/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}}}/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}}}/execute as @e[tag=c9_mob] at @s facing ~ ~ ~ run tp @s ^ ^ ^0.1 ~ ~/execute as @e[tag=c9_turret] at @s facing entity @e[tag=c9_mob,sort=nearest,limit=1] eyes run tp @s ~ ~ ~ ~ ~/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/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}/execute as @e[tag=c9_arrow] at @s facing entity @e[tag=c9_mob,sort=nearest,limit=1] eyes run tp @s ^ ^ ^1.2 ~ ~/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 forcesetup #8 Summons an oversized glowing <code>item_display</code> holding a loaded crossbow above the tower's lodestone core, rotated flat so it aims forward along its local Z-axis.loop #4 Draws the glowing cyan perimeter ring at an 11-block radius around the tower by projecting dust particles forward and backward from the spinning <code>c9_ctrl</code> marker.loop #10 Rotates the crossbow turret every tick so it smoothly aims directly at the eyes of the closest invading monster.loop #12 Fires a glowing critical arrow from the nose of the crossbow turret every two seconds whenever a target is inside the 16-block detection zone.loop #13 Guides each airborne arrow toward the nearest enemy at high speed so shots never miss moving invaders.


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.
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.
/kill @e[tag=c9_turret]/kill @e[tag=c9_ctrl]/kill @e[tag=c9_mob]/kill @e[tag=c9_arrow]/fill ~-2 ~ ~-2 ~2 ~6 ~2 air/scoreboard objectives remove c9_timerMake 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.
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.
▶Molten Glassblower Sphere-Launcher PipeProjectiles & MissilesHard22 cmds
▶Cataclysmic Super Fireball TurretProjectiles & MissilesEasy23 cmds
▶Expanding Ring of ArrowsProjectiles & MissilesEasy24 cmds
▶Heat-Seeking ArrowsProjectiles & MissilesMedium20 cmds
▶Scorched Earth Snowball BarrageProjectiles & MissilesEasy23 cmds
▶Terrain-Shattering ArrowsProjectiles & MissilesEasy25 cmds