Two armored crossbow sentries patrol a courtyard in formation, then break ranks to sprint behind deepslate barricades and crouch when a laser turret fires.
Custom MobsTechnologyFireMedievalRedOrangeBlackMap MakingAdventure MapCinematicArmor standsBlock building (fill/setblock/clone)Rotation math21+ commands
Watch two armored crossbow sentries patrol a stone courtyard in a synchronized circle. When the downrange dispenser turret begins charging with bright red sparks, both sentries immediately break formation, sprint toward the nearest waist-high deepslate barricade, and shrink down to crouch in cover while fiery laser bolts slam into the walls in front of them.
/scoreboard objectives add c9_t dummy/fill ~-9 ~-1 ~-8 ~9 ~-1 ~6 polished_andesite/fill ~-6 ~ ~-2 ~-2 ~ ~-2 deepslate_tile_wall/fill ~2 ~ ~-2 ~6 ~ ~-2 deepslate_tile_wall/setblock ~ ~ ~-7 dispenser[facing=south]/setblock ~ ~1 ~-7 redstone_lamp[lit=true]/summon armor_stand ~ ~ ~2 {Tags:["c9_ctrl"],Invisible:1b,NoGravity:1b,Marker:1b}/summon armor_stand ~-4 ~ ~-0.7 {Tags:["c9_cover","c9_c1"],Invisible:1b,NoGravity:1b,Marker:1b}/summon armor_stand ~4 ~ ~-0.7 {Tags:["c9_cover","c9_c2"],Invisible:1b,NoGravity:1b,Marker:1b}/summon armor_stand ~-2.5 ~ ~2 {Tags:["c9_sentry","c9_s1"],NoGravity:1b,ShowArms:1b,Glowing:1b,CustomName:'{"text":"Sentry Alpha","color":"aqua"}',CustomNameVisible:1b,equipment:{head:{id:"minecraft:netherite_helmet",count:1},chest:{id:"minecraft:iron_chestplate",count:1},legs:{id:"minecraft:iron_leggings",count:1},feet:{id:"minecraft:netherite_boots",count:1},mainhand:{id:"minecraft:crossbow",count:1}},Pose:{RightArm:[-30f,-20f,0f],LeftArm:[-30f,30f,0f]}}/execute unless entity @e[tag=c9_s2] run summon armor_stand ~2.5 ~ ~2 {Tags:["c9_sentry","c9_s2"],NoGravity:1b,ShowArms:1b,Glowing:1b,CustomName:'{"text":"Sentry Bravo","color":"aqua"}',CustomNameVisible:1b,equipment:{head:{id:"minecraft:netherite_helmet",count:1},chest:{id:"minecraft:iron_chestplate",count:1},legs:{id:"minecraft:iron_leggings",count:1},feet:{id:"minecraft:netherite_boots",count:1},mainhand:{id:"minecraft:crossbow",count:1}},Pose:{RightArm:[-30f,-20f,0f],LeftArm:[-30f,30f,0f]}}/scoreboard players add @e[tag=c9_ctrl] c9_t 1/execute if entity @e[tag=c9_ctrl,scores={c9_t=100..}] run scoreboard players set @e[tag=c9_ctrl] c9_t 0/execute if entity @e[tag=c9_ctrl,scores={c9_t=1..44}] as @e[tag=c9_sentry] run attribute @s minecraft:scale base set 1.0/execute if entity @e[tag=c9_ctrl,scores={c9_t=1..44}] as @e[tag=c9_sentry] at @s unless entity @e[tag=c9_ctrl,distance=..2.3] facing entity @e[tag=c9_ctrl,limit=1] feet run tp @s ^ ^ ^0.22 ~ ~/execute if entity @e[tag=c9_ctrl,scores={c9_t=1..44}] as @e[tag=c9_sentry] at @s if entity @e[tag=c9_ctrl,distance=..2.3] facing entity @e[tag=c9_ctrl,limit=1] feet rotated ~-86 0 run tp @s ^ ^ ^0.16 ~ ~/execute if entity @e[tag=c9_ctrl,scores={c9_t=45..99}] as @e[tag=c9_sentry] at @s unless entity @e[tag=c9_cover,distance=..0.7] facing entity @e[tag=c9_cover,sort=nearest,limit=1] feet run tp @s ^ ^ ^0.38 ~ ~/execute if entity @e[tag=c9_ctrl,scores={c9_t=45..99}] as @e[tag=c9_sentry] at @s if entity @e[tag=c9_cover,distance=..0.7] facing ~ ~ ~-7 run tp @s ~ ~ ~ ~ 0/execute if entity @e[tag=c9_ctrl,scores={c9_t=45..99}] as @e[tag=c9_sentry] at @s if entity @e[tag=c9_cover,distance=..0.7] run attribute @s minecraft:scale base set 0.58/execute if entity @e[tag=c9_ctrl,scores={c9_t=45..99}] run particle dust{color:[1.0,0.1,0.0],scale:2.2} ~ ~0.6 ~-5.9 0.35 0.35 0.35 0 10/execute if entity @e[tag=c9_ctrl,scores={c9_t=62..92}] unless entity @e[tag=c9_bolt] run summon armor_stand ~ ~0.6 ~-5.8 {Tags:["c9_bolt"],Invisible:1b,NoGravity:1b,Marker:1b}/execute as @e[tag=c9_bolt] at @s positioned ~ ~ ~-5.8 if entity @s[distance=..0.5] facing entity @e[tag=c9_cover,sort=random,limit=1] feet run tp @s ~ ~ ~ ~ ~/execute as @e[tag=c9_bolt] at @s run tp @s ^ ^ ^0.85/execute as @e[tag=c9_bolt] at @s run particle flame ~ ~ ~ 0.08 0.08 0.08 0.02 8/execute as @e[tag=c9_bolt] at @s unless block ~ ~ ~ air run particle lava ~ ~0.3 ~ 0.2 0.2 0.2 0 12/execute as @e[tag=c9_bolt] at @s unless block ~ ~ ~ air run kill @sloop #6 During the patrol phase (ticks 1 to 44), once a sentry reaches within 2.3 blocks of the central control marker, it rotates -86 degrees away from the center and steps forward, walking in a tight circle.loop #7 When the turret starts charging at tick 45, both sentries turn toward their nearest cover marker behind the deepslate walls and sprint toward it at 0.38 blocks per tick.loop #9 Once a sentry reaches its cover marker behind the barricade, its <code>minecraft:scale</code> attribute is lowered to 0.58 so it ducks below the top of the wall.loop #11 During ticks 62 to 92, whenever no bolt exists, a new laser bolt marker is summoned at the mouth of the dispenser turret and aimed at one of the two cover barricades.


Recorded on our own test server: 59 frames at about 9.8 fps. Our image check saw: Two armored pillager sentries patrol a stone platform, then run behind two deepslate walls and shrink down to take cover as a red-glowing turret shoots fire down the middle.
Commands, video and screenshots: tested and recorded by www.9minecraft.net © 9Minecraft. Sharing a video or screenshot? Please credit www.9minecraft.net.
To make the sentries react to a real player aiming at them instead of a timed turret, replace the c9_ctrl timer checks (scores={c9_t=45..99}) with if entity @a[nbt={SelectedItem:{id:"minecraft:crossbow"}}] so the guards immediately sprint to cover whenever a player draws a crossbow.
/kill @e[tag=c9_sentry]/kill @e[tag=c9_ctrl]/kill @e[tag=c9_cover]/kill @e[tag=c9_bolt]/scoreboard objectives remove c9_t/fill ~-9 ~-1 ~-8 ~9 ~1 ~6 air/fill ~-9 ~-1 ~-8 ~9 ~-1 ~6 grass_blockThe loop lowers their minecraft:scale attribute from 1.0 down to 0.58 as soon as they arrive within 0.7 blocks of the cover marker, making them drop below the deepslate wall height.
Yes. Summon additional armor stands with the c9_sentry tag and extra cover markers with the c9_cover tag behind new walls; each sentry automatically runs to the nearest cover marker.
/attribute/execute/fill/kill/particle/scoreboard/setblock/summon/tp
▶Da Vinci Ornithopter Griffin AutomatonCustom MobsExpert24 cmds
▶Autonomous Parkour RunnerCustom MobsHard24 cmds
▶Autonomous Pig-Piloted TankCustom MobsHard22 cmds
▶Flying Axemen SiegeCustom MobsMedium22 cmds
▶Jetpack Pillager PatrolCustom MobsMedium21 cmds
▶Jetpack Vindicator SquadronCustom MobsMedium24 cmds