Build an automated clockwork tower defense arena where glowing dispenser turrets track marching wither skeletons and fire homing cyan energy bolts.
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.
/scoreboard objectives add c9t dummy/fill ~-14 ~-1 ~-9 ~9 ~-1 ~-7 minecraft:polished_deepslate/fill ~7 ~-1 ~-9 ~9 ~-1 ~9 minecraft:polished_deepslate/fill ~-14 ~-1 ~7 ~9 ~-1 ~9 minecraft:polished_deepslate/fill ~-6 ~-1 ~-4 ~3 ~-1 ~4 minecraft:chiseled_copper/summon minecraft:marker ~8 ~ ~-8 {Tags:["c9_turn"],Rotation:[0.0f,0.0f]}/summon minecraft:marker ~8 ~ ~8 {Tags:["c9_turn"],Rotation:[90.0f,0.0f]}/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]}}/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]}}/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]}}/scoreboard players add #tick c9t 1/execute if score #tick c9t matches 20.. run scoreboard players set #tick c9t 0/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]}/execute as @e[tag=c9_mob] at @s run tp @s ^ ^ ^0.18/execute as @e[tag=c9_turn] at @s as @e[tag=c9_mob,distance=..0.4] run tp @s ^ ^ ^0.65 ~ ~/execute positioned ~-13 ~ ~8 as @e[tag=c9_mob,distance=..0.9] run kill @s/tag @e[tag=c9_mob,nbt=!{DeathTime:0s}] remove c9_mob/execute as @e[tag=c9_turret] at @s facing entity @e[tag=c9_mob,limit=1,sort=nearest,distance=..13] eyes run tp @s ~ ~ ~ ~ ~/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}/execute as @e[tag=c9_proj] at @s facing entity @e[tag=c9_mob,limit=1,sort=nearest] feet run tp @s ^ ^ ^0.75/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/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/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/execute as @e[tag=c9_proj] at @s if entity @e[tag=c9_mob,distance=..1.0] run kill @ssetup #6 Spawns a corner waypoint marker tagged <code>c9_turn</code> facing the exact yaw of the next road segment so one loop command can steer every corner.setup #8 Creates a glowing dispenser <code>block_display</code> with <code>teleport_duration:3</code> so its rotation interpolates smoothly while tracking invaders.loop #3 Spawns a new <code>NoAI</code> wither skeleton at the road entrance once every 20 ticks (1 second) as long as the spawn tile is clear.loop #5 When an invader enters 0.4 blocks of a <code>c9_turn</code> marker, it teleports 0.65 blocks into the marker's facing direction so it turns cleanly without re-triggering.loop #7 Strips the <code>c9_mob</code> tag as soon as a skeleton starts its death animation (<code>DeathTime</code> above 0), making turrets switch to living targets immediately.loop #9 Once per second, each turret with an invader within 13 blocks fires a glowing <code>item_display</code> projectile that homes toward the nearest target in the next command.loop #12 Deals 3 magic damage when a homing bolt gets within 1 block of an invader, followed by electric sparks and projectile removal.


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.
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.
/kill @e[tag=c9_mob]/kill @e[tag=c9_proj]/kill @e[tag=c9_turret]/kill @e[tag=c9_turn]/scoreboard objectives remove c9t/fill ~-14 ~-1 ~-9 ~9 ~-1 ~9 minecraft:grass_blockCheck 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.
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.
▶Monumental Dam Spillway Floodgate ReleaseSimulationsHard24 cmds
▶Particle Hadron Collider Beam ClashSimulationsHard24 cmds
▶Dynamic Swinging Rope Physics with Command BlocksSimulationsHard24 cmds
▶Autonomous Turret Defense ArenaSimulationsHard26 cmds
▶Kinetic Shrapnel DetonationSimulationsHard21 cmds
▶Obstacle-Weaving AutomatonSimulationsHard24 cmds