Headless Zombie Combat & Automated Turret

Build an automated crimson laser turret in Minecraft that locks onto incoming armored zombies and blasts their heads clean off using vanilla commands.

Java EditionMobs & PetsMedium26 commandsTested on a real 26.2 & 26.3 server
An automated turret fires red particles to knock the head off an approaching armored zombie. Download the GIF Video & GIF © www.9minecraft.net

Undead & HorrorTechnologyHorrorRedGoldMini-gameAdventure MapPvPBlock displaysItem displaysArmor standsSmooth animation (interpolation)Summoned mobsBlock building (fill/setblock/clone)Rotation math21+ commands

This command creation places an automated defense turret in the middle of a stone arena. As armored zombies shamble toward the center pillar, the turret locks onto the closest target and fires a crimson beam that knocks the zombie's head right off its shoulders.

Because you cannot normally hide just the head of a standard zombie, this build uses invisible zombies wearing full armor and a zombie head item. When the turret fires, it removes the helmet slot and summons a spinning display entity head that flies backward in an explosion of redstone blood particles while the headless body keeps walking.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9_timer dummy
  2. /scoreboard players set #tick c9_timer 0
  3. /fill ~-9 ~-1 ~-9 ~9 ~-1 ~9 polished_blackstone_bricks
  4. /fill ~-2 ~ ~-2 ~2 ~ ~2 polished_deepslate_slab[type=bottom]
  5. /setblock ~ ~ ~ chiseled_polished_blackstone
  6. /setblock ~ ~1 ~ nether_brick_fence
  7. /summon armor_stand ~ ~1.8 ~ {NoGravity:1b,Invisible:1b,Marker:1b,Tags:["c9_entity","c9_center"]}
  8. /summon item_display ~ ~1.8 ~ {Tags:["c9_entity","c9_turret"],item:{id:"minecraft:dispenser",count:1},transformation:{translation:[0.0f,0.0f,0.0f],left_rotation:[0.0f,0.0f,0.0f,1.0f],scale:[0.9f,0.9f,0.9f],right_rotation:[0.0f,0.0f,0.0f,1.0f]},teleport_duration:2,glowing:1b}
  9. /summon block_display ~-0.35 ~2.1 ~-0.35 {Tags:["c9_entity","c9_core"],block_state:{Name:"minecraft:redstone_block"},transformation:{translation:[0.0f,0.0f,0.0f],left_rotation:[0.0f,0.0f,0.0f,1.0f],scale:[0.7f,0.3f,0.7f],right_rotation:[0.0f,0.0f,0.0f,1.0f]},glowing:1b}
  10. /summon zombie ~-5 ~ ~4 {Tags:["c9_entity","c9_z","c9_has_head"],Silent:1b,IsBaby:0b,active_effects:[{id:"minecraft:invisibility",amplifier:0,duration:999999,show_particles:0b}],equipment:{head:{id:"minecraft:zombie_head",count:1},chest:{id:"minecraft:iron_chestplate",count:1},legs:{id:"minecraft:chainmail_leggings",count:1},feet:{id:"minecraft:iron_boots",count:1},mainhand:{id:"minecraft:iron_sword",count:1}}}

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

  1. /scoreboard players add #tick c9_timer 1
  2. /execute if score #tick c9_timer matches 40.. run scoreboard players set #tick c9_timer 0
  3. /execute if score #tick c9_timer matches 1 unless entity @e[tag=c9_z,distance=..15,limit=7] run summon zombie ~-6 ~ ~5 {Tags:["c9_entity","c9_z","c9_has_head"],Silent:1b,IsBaby:0b,active_effects:[{id:"minecraft:invisibility",amplifier:0,duration:999999,show_particles:0b}],equipment:{head:{id:"minecraft:zombie_head",count:1},chest:{id:"minecraft:iron_chestplate",count:1},legs:{id:"minecraft:chainmail_leggings",count:1},feet:{id:"minecraft:iron_boots",count:1},mainhand:{id:"minecraft:iron_sword",count:1}}}
  4. /execute if score #tick c9_timer matches 21 unless entity @e[tag=c9_z,distance=..15,limit=7] run summon zombie ~6 ~ ~4 {Tags:["c9_entity","c9_z","c9_has_head"],Silent:1b,IsBaby:0b,active_effects:[{id:"minecraft:invisibility",amplifier:0,duration:999999,show_particles:0b}],equipment:{head:{id:"minecraft:zombie_head",count:1},chest:{id:"minecraft:golden_chestplate",count:1},legs:{id:"minecraft:iron_leggings",count:1},feet:{id:"minecraft:golden_boots",count:1},mainhand:{id:"minecraft:golden_axe",count:1}}}
  5. /execute as @e[tag=c9_z] at @s facing entity @e[tag=c9_center,limit=1] feet run tp @s ^ ^ ^0.06 ~ 0
  6. /execute as @e[tag=c9_turret] at @s facing entity @e[tag=c9_has_head,sort=nearest,limit=1] eyes run tp @s ~ ~ ~ ~ ~
  7. /execute at @e[tag=c9_turret] run particle flame ~ ~0.4 ~ 0.15 0.15 0.15 0.01 1 force
  8. /execute if score #tick c9_timer matches 10..15 at @e[tag=c9_turret] facing entity @e[tag=c9_has_head,sort=nearest,limit=1] eyes run particle dust{color:[1.0,0.1,0.1],scale:1.5} ^ ^ ^1 0.05 0.05 0.05 0 4 force
  9. /execute if score #tick c9_timer matches 10..15 at @e[tag=c9_turret] facing entity @e[tag=c9_has_head,sort=nearest,limit=1] eyes run particle dust{color:[1.0,0.1,0.1],scale:1.5} ^ ^ ^2.5 0.05 0.05 0.05 0 4 force
  10. /execute if score #tick c9_timer matches 10..15 at @e[tag=c9_turret] facing entity @e[tag=c9_has_head,sort=nearest,limit=1] eyes run particle dust{color:[1.0,0.1,0.1],scale:1.5} ^ ^ ^4 0.05 0.05 0.05 0 4 force
  11. /execute if score #tick c9_timer matches 15 as @e[tag=c9_has_head,sort=nearest,limit=1] at @s run summon item_display ~ ~1.6 ~ {Tags:["c9_entity","c9_head"],item:{id:"minecraft:zombie_head",count:1},Glowing:1b,interpolation_duration:15,start_interpolation:0,transformation:{translation:[0.0f,0.8f,-1.5f],left_rotation:[0.7f,0.4f,0.3f,0.5f],scale:[1.0f,1.0f,1.0f],right_rotation:[0.0f,0.0f,0.0f,1.0f]}}
  12. /execute if score #tick c9_timer matches 15 as @e[tag=c9_has_head,sort=nearest,limit=1] at @s run particle block{block_state:{Name:"minecraft:redstone_block"}} ~ ~1.6 ~ 0.25 0.25 0.25 0.15 45 force
  13. /execute if score #tick c9_timer matches 15 as @e[tag=c9_has_head,sort=nearest,limit=1] run item replace entity @s armor.head with air
  14. /execute as @e[tag=c9_entity,tag=!c9_turret,tag=!c9_core,tag=!c9_center] at @s run scoreboard players add @s c9_timer 1
  15. /execute if score #tick c9_timer matches 16 as @e[tag=c9_has_head,sort=nearest,limit=1] run tag @s remove c9_has_head
  16. /kill @e[tag=c9_entity,scores={c9_timer=120..}]

How it works

Frames from the test run

Headless Zombie Combat & Automated Turret - frame 1Headless Zombie Combat & Automated Turret - frame 2Headless Zombie Combat & Automated Turret - frame 3

Recorded on our own test server: 59 frames at about 9.8 fps. Our image check saw: A central dispenser turret on a stone brick arena fires red particles at an approaching gold-armored zombie, knocking its glowing head off its body.

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. Create a flat area and stand where you want the center turret to be built.
  2. Run each of the 10 setup commands in chat or in impulse command blocks at the center position to create the scoreboard, arena floor, and turret.
  3. Place a line of 14 repeating command blocks (or 1 repeating followed by 13 chain command blocks), all set to Always Active.
  4. Paste the loop commands in order into the command blocks. Note: to stay within 14 loop blocks, you can combine or omit one of the three beam particle distances if desired.
  5. Watch as zombies spawn on both sides, lose their heads to the crimson laser, and march headless toward the center before despawning.

Use it with real players

To trigger the headless decapitation when you hit a zombie yourself instead of using the turret, summon the invisible armored zombies with the c9_has_head tag and detect when their HurtTime NBT equals 10s: /execute as @e[tag=c9_has_head,nbt={HurtTime:10s}] at @s run item replace entity @s armor.head with air, followed by the particle and flying head display commands.

Remove it again 4 commands

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

FAQ

Why doesn't the zombie burn in daylight if I run this during the day?

Because the zombie spawns with a zombie head equipped in its armor helmet slot, Minecraft protects it from sunlight damage until the turret shoots the helmet off.

Can I change the armor the headless zombies wear?

Yes. In the summon commands, edit the equipment NBT compound to use diamond_chestplate, netherite_chestplate, or any dyed leather armor.

Commands used

/execute/fill/item/kill/particle/scoreboard/setblock/summon/tag/tp

Similar creations

Join 9Minecraft News & Guides