Autonomous Sweeper Bot

A miniature, custom-modeled robot zips around a messy arena, vacuuming up dropped items with vortex particles and bulldozing wandering mobs out of its way.

Java EditionMobs & PetsMedium24 commandsTested on a real 26.2 & 26.3 server
An autonomous yellow sweeper bot collects dropped treasures across a white tiled arena. Download the GIF Video & GIF © www.9minecraft.net

Custom MobsTechnologyCuteYellowBlueWhiteDecorationMini-gameServer LobbyBlock displaysArmor standsRiding & passengersSummoned mobsBlock building (fill/setblock/clone)Rotation math21+ commands

Keep your world spotless with the Autonomous Sweeper Bot. Built using block display entities mounted onto an invisible silverfish chassis, this compact yellow-and-iron robot features a glowing blue core and an iron dozer blade. In this demo, it zips across a tiled test arena, tracking down spilled emeralds, gold, and diamonds while leaving a sparkling trail of clean air behind.

The bot doesn't let anyone get in the way of its cleaning routine. Any wandering mobs that step into its path are immediately scooped up by the front blade and launched upward into the air with a comical clang and a burst of angry steam particles.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9_timer dummy
  2. /scoreboard objectives add c9_items dummy
  3. /scoreboard players set #items c9_items 0
  4. /fill ~-9 ~-1 ~-9 ~9 ~-1 ~9 smooth_stone
  5. /fill ~-8 ~-1 ~-8 ~8 ~-1 ~8 quartz_bricks
  6. /fill ~-9 ~ ~-9 ~9 ~ ~9 smooth_stone_slab hollow
  7. /fill ~-8 ~ ~-8 ~8 ~ ~8 air
  8. /summon silverfish ~ ~ ~ {Tags:["c9_bot","c9_entity"],Silent:1b,Invulnerable:1b,PersistenceRequired:1b,CustomName:'{"text":"Sweeper-9000","color":"aqua"}',CustomNameVisible:1b,active_effects:[{id:"minecraft:invisibility",duration:999999,show_particles:0b}],Passengers:[{id:"minecraft:block_display",Tags:["c9_bot_part","c9_entity"],block_state:{Name:"minecraft:yellow_concrete"},transformation:{translation:[-0.45f,0.05f,-0.45f],scale:[0.9f,0.3f,0.9f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}},{id:"minecraft:block_display",Tags:["c9_bot_part","c9_entity"],block_state:{Name:"minecraft:gray_concrete"},transformation:{translation:[-0.5f,0.0f,-0.5f],scale:[1.0f,0.12f,1.0f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}},{id:"minecraft:block_display",Tags:["c9_bot_part","c9_entity"],block_state:{Name:"minecraft:sea_lantern"},Glowing:1b,transformation:{translation:[-0.2f,0.2f,-0.2f],scale:[0.4f,0.22f,0.4f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}},{id:"minecraft:block_display",Tags:["c9_bot_part","c9_entity"],block_state:{Name:"minecraft:iron_block"},transformation:{translation:[-0.55f,0.02f,0.4f],scale:[1.1f,0.25f,0.15f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}]}
  9. /summon armor_stand ~ ~ ~ {Tags:["c9_spawner","c9_entity"],Invisible:1b,NoGravity:1b,Marker:1b}
  10. /summon sheep ~3 ~ ~3 {Tags:["c9_mob","c9_entity"],NoAI:1b,Invulnerable:1b,Silent:1b,Color:14b}

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

  1. /scoreboard players add @e[tag=c9_bot] c9_timer 1
  2. /execute as @e[tag=c9_spawner] at @e[tag=c9_bot,limit=1] run tp @s ~ ~ ~ ~23 ~
  3. /execute as @e[tag=c9_bot,scores={c9_timer=12..}] run scoreboard players set @s c9_timer 0
  4. /execute if score @e[tag=c9_bot,limit=1] c9_timer matches 1 run execute store result score #items c9_items run execute if entity @e[type=item,tag=c9_mess]
  5. /execute if score @e[tag=c9_bot,limit=1] c9_timer matches 1 if score #items c9_items matches ..14 at @e[tag=c9_spawner] positioned ^ ^ ^4.5 if block ~ ~-1 ~ quartz_bricks run summon item ~ ~0.2 ~ {Tags:["c9_mess","c9_entity"],PickupDelay:32767,Age:5400,Item:{id:"minecraft:emerald",count:1}}
  6. /execute if score @e[tag=c9_bot,limit=1] c9_timer matches 7 if score #items c9_items matches ..14 at @e[tag=c9_spawner] positioned ^ ^ ^-3.5 if block ~ ~-1 ~ quartz_bricks run summon item ~ ~0.2 ~ {Tags:["c9_mess","c9_entity"],PickupDelay:32767,Age:5400,Item:{id:"minecraft:gold_ingot",count:1}}
  7. /execute if score @e[tag=c9_bot,limit=1] c9_timer matches 4 unless entity @e[tag=c9_mob] at @e[tag=c9_spawner] positioned ^3 ^ ^2 if block ~ ~-1 ~ quartz_bricks run summon pig ~ ~ ~ {Tags:["c9_mob","c9_entity"],Silent:1b,Invulnerable:1b}
  8. /execute as @e[tag=c9_bot] at @s if entity @e[type=item,tag=c9_mess,distance=..15] facing entity @e[type=item,tag=c9_mess,distance=..15,sort=nearest,limit=1] feet run tp @s ^ ^ ^0.28 ~ ~
  9. /execute as @e[tag=c9_bot] at @s unless entity @e[type=item,tag=c9_mess,distance=..15] run tp @s ^ ^ ^0.2 ~6 ~
  10. /execute as @e[tag=c9_bot] at @s run particle dust{color:[0.1,0.9,1.0],scale:1.0} ~ ~0.15 ~ 0.25 0.05 0.25 0 2
  11. /execute at @e[tag=c9_bot] as @e[type=item,tag=c9_mess,distance=..2.8] at @s facing entity @e[tag=c9_bot,limit=1] feet run tp @s ^ ^ ^0.35
  12. /execute at @e[tag=c9_bot] if entity @e[type=item,tag=c9_mess,distance=..0.9] run particle poof ~ ~0.2 ~ 0.15 0.15 0.15 0.05 6
  13. /execute at @e[tag=c9_bot] run kill @e[type=item,tag=c9_mess,distance=..0.9]
  14. /execute at @e[tag=c9_bot] as @e[tag=c9_mob,distance=..1.8] at @s facing entity @e[tag=c9_bot,limit=1] feet run data merge entity @s {Motion:[0.0,0.55,0.0],NoAI:0b}

How it works

Frames from the test run

Autonomous Sweeper Bot - frame 1Autonomous Sweeper Bot - frame 2Autonomous Sweeper Bot - frame 3

Recorded on our own test server: 60 frames at about 9.9 fps. Our image check saw: A small yellow and grey sweeper robot moves across a white tiled arena, collecting dropped gold and emerald items while emitting blue and white particles near a red sheep.

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 run the setup commands in order to build the test arena and spawn the Sweeper-9000 robot.
  2. Place 14 repeating command blocks in a line or column near the arena.
  3. Set every repeating command block to 'Always Active'.
  4. Paste each of the 14 loop commands into the repeating command blocks.
  5. Watch the bot automatically patrol the floor, suck up dropped treasures, and punt mobs out of its way.

Use it with real players

To make the Sweeper Bot clean up any real player drops in survival or creative mode without the self-spawning mess, remove loop commands 4, 5, and 6, and delete tag=c9_mess from the item target selectors in commands 7, 8, 10, 11, and 12. You can also replace tag=c9_mob in command 13 with type=!player,type=!item,type=!block_display,tag=!c9_entity so it bulldozes any regular creature in your base.

Remove it again 5 commands

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

FAQ

Why is the robot built on top of a silverfish?

Mounting block display entities as passengers on a living mob allows the entire multi-part model to move and rotate smoothly with a single teleport command while keeping a compact, ground-level name tag.

Can I change the color of the Sweeper Bot?

Yes! In the setup summon command, change yellow_concrete to any other block such as red_concrete, amethyst_block, or copper_block to customize its outer shell.

Commands used

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

Similar creations

Join 9Minecraft News & Guides