Clockwork Siege Defense

Build an automated clockwork tower defense arena where glowing dispenser turrets track marching wither skeletons and fire homing cyan energy bolts.

Java EditionComplex Contraptions & CinematicsHard24 commandsTested on a real 26.2 & 26.3 server
Three glowing turrets on a copper pad fire projectiles at wither skeletons marching along a deepslate path. Download the GIF Video & GIF © www.9minecraft.net

SimulationsTechnologyIndustrialMedievalOrangeCyanBlackMini-gameAdventure MapMap MakingBlock displaysItem displaysSmooth animation (interpolation)Summoned mobsBlock building (fill/setblock/clone)Rotation math21+ commands

Watch waves of wither skeletons march along a deepslate siege road while three glowing Clockwork Turrets perched on a central copper citadel swivel smoothly and launch homing cyan bolts at the invaders.

Using only block_display, item_display, and marker entities, the entire tower-defense arena runs automatically with clean corner turns, particle trails, and spark bursts on impact.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9t dummy
  2. /fill ~-14 ~-1 ~-9 ~9 ~-1 ~-7 minecraft:polished_deepslate
  3. /fill ~7 ~-1 ~-9 ~9 ~-1 ~9 minecraft:polished_deepslate
  4. /fill ~-14 ~-1 ~7 ~9 ~-1 ~9 minecraft:polished_deepslate
  5. /fill ~-6 ~-1 ~-4 ~3 ~-1 ~4 minecraft:chiseled_copper
  6. /summon minecraft:marker ~8 ~ ~-8 {Tags:["c9_turn"],Rotation:[0.0f,0.0f]}
  7. /summon minecraft:marker ~8 ~ ~8 {Tags:["c9_turn"],Rotation:[90.0f,0.0f]}
  8. /summon minecraft:block_display ~-5 ~0.9 ~-3 {Tags:["c9_turret"],Glowing:1b,teleport_duration:3,block_state:{Name:"minecraft:dispenser",Properties:{facing:"south"}},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-0.45f,-0.45f,-0.45f],scale:[0.9f,0.9f,0.9f]}}
  9. /summon minecraft:block_display ~2 ~0.9 ~0 {Tags:["c9_turret"],Glowing:1b,teleport_duration:3,block_state:{Name:"minecraft:dispenser",Properties:{facing:"south"}},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-0.45f,-0.45f,-0.45f],scale:[0.9f,0.9f,0.9f]}}
  10. /summon minecraft:block_display ~-5 ~0.9 ~3 {Tags:["c9_turret"],Glowing:1b,teleport_duration:3,block_state:{Name:"minecraft:dispenser",Properties:{facing:"south"}},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-0.45f,-0.45f,-0.45f],scale:[0.9f,0.9f,0.9f]}}

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

  1. /scoreboard players add #tick c9t 1
  2. /execute if score #tick c9t matches 20.. run scoreboard players set #tick c9t 0
  3. /execute if score #tick c9t matches 1 positioned ~-13 ~ ~-8 unless entity @e[tag=c9_mob,distance=..2] run summon minecraft:wither_skeleton ~ ~ ~ {Tags:["c9_mob"],NoAI:1b,Silent:1b,PersistenceRequired:1b,DeathLootTable:"minecraft:empty",Rotation:[-90.0f,0.0f]}
  4. /execute as @e[tag=c9_mob] at @s run tp @s ^ ^ ^0.18
  5. /execute as @e[tag=c9_turn] at @s as @e[tag=c9_mob,distance=..0.4] run tp @s ^ ^ ^0.65 ~ ~
  6. /execute positioned ~-13 ~ ~8 as @e[tag=c9_mob,distance=..0.9] run kill @s
  7. /tag @e[tag=c9_mob,nbt=!{DeathTime:0s}] remove c9_mob
  8. /execute as @e[tag=c9_turret] at @s facing entity @e[tag=c9_mob,limit=1,sort=nearest,distance=..13] eyes run tp @s ~ ~ ~ ~ ~
  9. /execute if score #tick c9t matches 10 as @e[tag=c9_turret] at @s if entity @e[tag=c9_mob,distance=..13] run summon minecraft:item_display ~ ~0.2 ~ {Tags:["c9_proj"],item:{id:"minecraft:blaze_powder",count:1},billboard:"center",Glowing:1b,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[0.75f,0.75f,0.75f]},teleport_duration:1}
  10. /execute as @e[tag=c9_proj] at @s facing entity @e[tag=c9_mob,limit=1,sort=nearest] feet run tp @s ^ ^ ^0.75
  11. /execute as @e[tag=c9_proj] at @s run particle minecraft:dust{color:[0.1,0.9,1.0],scale:1.2} ~ ~ ~ 0.05 0.05 0.05 0 2
  12. /execute as @e[tag=c9_proj] at @s as @e[tag=c9_mob,distance=..1.0,limit=1,sort=nearest] run damage @s 3 minecraft:magic
  13. /execute as @e[tag=c9_proj] at @s if entity @e[tag=c9_mob,distance=..1.0] run particle minecraft:electric_spark ~ ~0.5 ~ 0.25 0.25 0.25 0.12 8
  14. /execute as @e[tag=c9_proj] at @s if entity @e[tag=c9_mob,distance=..1.0] run kill @s

How it works

Frames from the test run

Clockwork Siege Defense - frame 1Clockwork Siege Defense - frame 2Clockwork Siege Defense - frame 3

Recorded on our own test server: 37 frames at about 6.2 fps. Our image check saw: Three glowing block turrets on a flat copper square rotate to fire glowing projectiles with blue particle trails and impact sparks at wither skeletons marching along a deepslate road.

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. Clear a flat 41x41 grass area and stand at the exact centre block.
  2. Run each of the 10 setup commands once in chat (or in impulse command blocks at the centre) to build the deepslate road, copper citadel, turn markers, and turrets.
  3. Place 14 Repeating Command Blocks set to Always Active near the centre, and wrap or offset their coordinates if they are not sitting at the exact centre block.
  4. Paste the 14 loop commands into the repeating command blocks in order from 1 to 14.
  5. Set the game difficulty to Easy, Normal, or Hard and set the time to night so the glowing turrets and cyan bolt trails stand out clearly.

Use it with real players

This defense system runs automatically on its own, and players can join the battle in Survival or Adventure mode by guarding the south road exit with melee weapons or bows alongside the three turrets. To scale the challenge up or down, change the 3 in the /damage loop command to adjust turret firepower.

Remove it again 6 commands

  1. /kill @e[tag=c9_mob]
  2. /kill @e[tag=c9_proj]
  3. /kill @e[tag=c9_turret]
  4. /kill @e[tag=c9_turn]
  5. /scoreboard objectives remove c9t
  6. /fill ~-14 ~-1 ~-9 ~9 ~-1 ~9 minecraft:grass_block

FAQ

Why are the invaders not spawning?

Check that your world difficulty is not set to Peaceful, as Peaceful mode immediately despawns wither skeletons. Also verify that the first two loop commands are running so the <code>c9t</code> timer increments.

Can I change the turret fire rate or damage?

Yes. Lower the <code>3</code> in the <code>/damage</code> command for tougher waves, or change <code>matches 20..</code> and add another firing tick to make the turrets shoot faster.

Commands used

/damage/execute/fill/kill/particle/scoreboard/summon/tag/tp

Similar creations

Join 9Minecraft News & Guides