Autonomous Sweeper & Sentry Drones

Custom block-display sweeper robots automatically collect arena debris while a central automated laser sentry turret tracks and zaps nearby intruders.

Java EditionComplex Contraptions & CinematicsHard24 commandsTested on a real 26.2 & 26.3 server
Three glowing cyan sweeper drones patrol a square arena around a central red sentry turret. Download the GIF Video & GIF © www.9minecraft.net

Factories & MachinesTechnologyIndustrialCyanRedWhiteMap MakingMini-gameDecorationBlock displaysArmor standsSummoned mobsBlock building (fill/setblock/clone)Rotation math21+ commands

This command creation builds a sci-fi security test pad right in your world. Three custom-modeled robotic sweepers patrol the floor, automatically steering toward dropped debris and vacuuming it up with cyan particle bursts. In the center of the arena stands an elevated automated sentry turret with a glowing core that tracks an intruder drone circling the perimeter, firing high-energy crimson laser pulses whenever it locks on.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9_t dummy
  2. /fill ~-9 ~-1 ~-9 ~9 ~-1 ~9 minecraft:iron_block
  3. /fill ~-9 ~-1 ~-9 ~9 ~-1 ~9 minecraft:polished_deepslate replace minecraft:iron_block
  4. /fill ~-7 ~-1 ~-7 ~7 ~-1 ~7 minecraft:quartz_bricks
  5. /setblock ~ ~ ~ minecraft:lodestone
  6. /summon minecraft:block_display ~ ~1 ~ {Tags:["c9_all","c9_turret"],Glowing:1b,glow_color_override:16724787,block_state:{Name:"minecraft:observer"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[1.2f,1.2f,1.2f],translation:[-0.6f,-0.5f,-0.6f]}}
  7. /summon minecraft:armor_stand ~6 ~0.5 ~ {Tags:["c9_all","c9_target"],NoGravity:1b,Small:1b,Glowing:1b,armor_items:[{},{},{},{id:"minecraft:redstone_block",count:1}],CustomName:'{"text":"Intruder Drone","color":"red"}',CustomNameVisible:1b}
  8. /summon minecraft:block_display ~-4 ~0.1 ~-4 {Tags:["c9_all","c9_sweep"],Glowing:1b,glow_color_override:5636095,block_state:{Name:"minecraft:sea_lantern"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.9f,0.35f,0.9f],translation:[-0.45f,0f,-0.45f]}}
  9. /summon minecraft:block_display ~4 ~0.1 ~-4 {Tags:["c9_all","c9_sweep"],Glowing:1b,glow_color_override:5636095,block_state:{Name:"minecraft:sea_lantern"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.9f,0.35f,0.9f],translation:[-0.45f,0f,-0.45f]}}
  10. /summon minecraft:block_display ~ ~0.1 ~5 {Tags:["c9_all","c9_sweep"],Glowing:1b,glow_color_override:5636095,block_state:{Name:"minecraft:sea_lantern"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.9f,0.35f,0.9f],translation:[-0.45f,0f,-0.45f]}}

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

  1. /scoreboard players add #tick c9_t 1
  2. /execute if score #tick c9_t matches 80.. run scoreboard players set #tick c9_t 0
  3. /execute if score #tick c9_t matches 1 run summon minecraft:item ~-4 ~1 ~3 {Tags:["c9_all","c9_debris"],Glowing:1b,PickupDelay:32767,Age:5880,Item:{id:"minecraft:amethyst_shard",count:1}}
  4. /execute if score #tick c9_t matches 25 run summon minecraft:item ~4 ~1 ~-2 {Tags:["c9_all","c9_debris"],Glowing:1b,PickupDelay:32767,Age:5880,Item:{id:"minecraft:raw_gold",count:1}}
  5. /execute if score #tick c9_t matches 50 run summon minecraft:item ~1 ~1 ~-5 {Tags:["c9_all","c9_debris"],Glowing:1b,PickupDelay:32767,Age:5880,Item:{id:"minecraft:prismarine_crystals",count:1}}
  6. /execute as @e[tag=c9_sweep] at @s facing entity @e[tag=c9_debris,limit=1,sort=nearest] feet run tp @s ^ ^ ^0.18 ~ 0
  7. /execute as @e[tag=c9_sweep] at @s unless entity @e[tag=c9_debris] facing ~ ~0.1 ~ run tp @s ^0.15 ^ ^ ~10 0
  8. /execute as @e[tag=c9_sweep] at @s run particle minecraft:dust{color:[0.1,0.9,1.0],scale:1.0} ~ ~0.1 ~ 0.25 0.02 0.25 0 2
  9. /execute at @e[tag=c9_sweep] as @e[tag=c9_debris,distance=..1.1] at @s run particle minecraft:soul_fire_flame ~ ~0.2 ~ 0.15 0.15 0.15 0.05 12
  10. /execute at @e[tag=c9_sweep] run kill @e[tag=c9_debris,distance=..1.1]
  11. /execute as @e[tag=c9_target] at @s facing ~ ~0.5 ~ run tp @s ^-0.24 ^ ^0.02 ~ 0
  12. /execute as @e[tag=c9_turret] at @s facing entity @e[tag=c9_target,limit=1] eyes run tp @s ~ ~ ~ ~ ~
  13. /execute as @e[tag=c9_turret] at @s run particle minecraft:dust{color:[1.0,0.1,0.1],scale:1.2} ^ ^ ^1.5 0.05 0.05 0.05 0 2
  14. /execute if score #tick c9_t matches 1..20 as @e[tag=c9_turret] at @s run particle minecraft:electric_spark ^ ^ ^3.5 0.8 0.2 0.8 0.02 8

How it works

Frames from the test run

Autonomous Sweeper & Sentry Drones - frame 1Autonomous Sweeper & Sentry Drones - frame 2Autonomous Sweeper & Sentry Drones - frame 3

Recorded on our own test server: 58 frames at about 9.5 fps. Our image check saw: A gray square test pad with a central red turret, three cyan glowing sweeper drones emitting particles, and dropped items on the floor.

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. Stand in the center of a flat open area and run the 10 setup commands in chat one by one.
  2. Verify that the quartz and deepslate arena floor appears along with the central turret, three cyan floor sweepers, and the red Intruder Drone.
  3. Place a column or line of 14 Repeating Command Blocks nearby (or 1 Repeating block leading into 13 Chain blocks), all set to Always Active.
  4. Paste one loop command into each command block in the exact order listed.
  5. Watch the sweepers automatically chase down spawned crystal debris while the central sentry locks onto the orbiting intruder.

Use it with real players

To make the sentry turret track real players instead of the demo drone, replace @e[tag=c9_target,limit=1] in loop command 12 with @p[distance=..10]. You can also let the sweepers clean up any dropped items by removing tag=c9_debris and filtering by type=item,distance=..10 instead.

Remove it again 4 commands

  1. /kill @e[tag=c9_all]
  2. /scoreboard objectives remove c9_t
  3. /fill ~-9 ~-1 ~-9 ~9 ~-1 ~9 minecraft:grass_block
  4. /setblock ~ ~ ~ minecraft:air

FAQ

Why won't the sweepers pick up items I drop myself?

By default, the sweepers only target items with the c9_debris tag so they don't accidentally delete your gear. Check the player version tip above to let them vacuum any dropped item.

Will the spawned debris cause lag over time?

No, debris only spawns three times every 4 seconds, gets deleted immediately by the sweepers, and has a short built-in despawn age of 6 seconds as a backup safety limit.

Commands used

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

Similar creations

Join 9Minecraft News & Guides