Friends and foes
Raiding enemy bases
How bots learn where an enemy base is, slip inside, empty its chests and trap the way out, and what you can do about it.
Some bots rob their enemies as well as fighting them. A raiding bot learns where an enemy base is by watching it, the way a player would. It scouts the base, waits for nightfall, then tunnels under the wall or slips past it. It empties a chest, leaves a TNT trap on its way out and sprints home if anyone spots it. The shipped Flanker style plays like this, and custom styles opt in with two play-style keys. In turn, any bot base that notices it has been robbed hunts the thief and raids back, whatever its style.
Raids are legit like everything else. A raider opens chests with its own clicks, throws pearls it earned from endermen and breaks blocks at normal speed. Protection mods stop it the same way they stop a player.
An act of war
A raid only happens between two factions set to enemy. A grudge alone never sends a bot after your chests.
A player without a faction is never a raid target either, because there’s no faction to learn a base about.
Raids also need the pvp game rule on. With /gamerule pvp false, no bot raids anyone, and a raid in
progress when pvp is turned off breaks off and goes home right away. A bot also doesn’t raid while an
attack, defend or follow order is active.
Finding the enemy base
A faction learns where its enemies live from what its bots see:
- Once a second, a bot looks at the structure blocks within 24 blocks of every live enemy in sight (beds, chests, doors, fences and fence gates, crafting tables, furnaces and torches), plus the player-built iron golems standing with them. It attributes them to that enemy’s faction.
- Standing near something doesn’t prove an enemy owns it, so a base learned this way is only suspected. An enemy who walks past your chests (or past a dungeon, or a village) doesn’t make them theirs.
- A base becomes confirmed when a bot sees the owners use it or live in it. Seeing an enemy open one of its chests or sleep in one of its beds confirms it right away. Seeing an enemy standing inside it on three separate occasions, at least two minutes apart, confirms it over time. Only a confirmed base is ever raided, and only a confirmed base keeps growing as more of it is seen.
A bot never attributes anything inside its own base, an ally’s or a neutral’s, whoever stands next to it. The same goes for anything in a house one of its faction mates built or is building. A chest that still holds its generated loot (a dungeon chest nobody has opened) belongs to nobody. A block inside a hidden base counts only when the bot sees it with nothing in between, so a base dug into a hill is found by following its owner in, not by walking past the hill.
Everything a faction learns goes into one record per enemy faction. It holds where the base is and how big it is, up to 16 of its chests (with whatever a raid read inside them), its known wall gates, its golem count, where its traps lie and how strong the guard that last spotted a raider was. What one bot sees, the rest of its faction knows within a second, and the records are saved with the world.
Scouting
A style with the chest_raid tactic sends out scouts:
- If it knows no confirmed base for an enemy faction, a bot walks to where that faction’s members were last seen and searches the area, recording what it sees, until a base turns up or it gives up for a while.
- A suspected base gets watched. The scout walks to the edge nearest its home and stands facing the middle for up to 30 seconds. If it catches the owners coming and going, the base gets confirmed. After three watches that find it empty, the faction drops it.
A scout that runs into an enemy fights or flees like any bot would. A scout with the elytra tactic that can fly
searches by air instead.
Hiding your base works
Bots only raid a confirmed base, and a base gets confirmed when its owners are seen at home. Settling out of enemy bots’ roaming range, or not being seen using your base, buys real safety. If you spot a bot standing at the edge of your yard staring at your house, that’s a scout watching it. It’s waiting to see you inside, since a watch that sees an owner inside counts toward confirming the base. Leave it nothing to see, or deal with it from outside your base.
The reveal cheat
For showcase servers, a difficulty’s cheats block can set reveal_enemy_bases. With cheats allowed by the
server and turned on for the bot, it knows every enemy faction’s base (chests and contents included) as
confirmed, with no scouting needed. See Difficulty and cheats.
The raid
When the odds allow, a raider picks the freshest confirmed enemy base within twice its roaming radius and goes to work. It needs a chest nobody has emptied yet, at least eight free inventory slots and enough health. The guard also has to be one it can take, judged by the gear comparison against the strongest enemy recently seen at that base (see Combat and safety). Unlike hunting, raiding needs no aggression.
A raid runs in phases. The raider approaches the base, gets in (below), loots the known chest nearest the way in, optionally lays a trap, then leaves the way it came and heads home.
At the chest, the raider opens it with its own click and quick-moves stacks into its inventory, most valuable first, until two slots are free or the chest is empty. The order goes: the dragon egg, an elytra, the dragon head, netherite, shulker shells, diamond, gold and iron items, enchanted anything, armor and weapons, ender pearls, gunpowder, food, arrows, then everything else. The raider remembers what’s left behind. It leaves an emptied chest alone for an in-game day, even if it’s restocked right after.
An enemy’s shulker box counts as one of its chests. A raider with a free slot breaks the box and carries it off whole, contents and all. If a protection mod refuses the break, it loots the box like a chest instead. The End’s trophies sit in a base’s innermost chest, the one a raider opens last, so a raid that gets that far can carry off the egg itself. A machine in the enemy’s machine yard (a kiln or another mod’s machine with a menu) is known like a chest and comes after the chests. Once those are done, the raider opens the machine with its own click, takes what it holds, then breaks it and carries it home.
Back home, the loot goes into the base’s chests like any surplus. A raider never counts an enemy’s chests as its own stock, and never stows anything into them.
A fight or a survival need interrupts a raid like anything else. A raid interrupted while looting or on the way home picks up again with the trip home, never with the chest. If vanilla or a protection mod refuses a chest, the raid fails right there and the base gets a rest. A chest the raider can’t reach is skipped for a while, and it tries the next known chest.
Raids happen at night
A raid picked during the day waits for dusk. While it waits, the raider gets ready. It gets a stone pickaxe if
it has none (for the tunnel, with the block_theft tactic) and up to a stack of cobblestone to seal its way,
kept in hand. After that the raid scores nothing until sunset, and the bot spends the day on other work.
A bot that has decided to raid gives its night to the raid. It doesn’t head indoors at dark or dig a burrow,
while every other bot spends its night as usual, and from dusk the prepared raid comes before the night’s work
(its mine, its gear, its building) even when that work scores more. Survival, a fight and an order still come
first. Two kinds of raider don’t wait for dusk: one whose target is
more than a day’s walk away, and one with a bold style (risk_tolerance above 0.9). The raid runs until dawn.
By air
A raider whose style lists the elytra tactic (the shipped Flanker) can fly its way in, as long as it holds a
sound elytra and the rockets the flight needs. The flight’s own rules have to allow the leg
(flying with an elytra). The leg has to be at least 200 blocks,
with a launch from where it stands, from a high point within 16 blocks or from a pillar of its own blocks. It
never launches within 32 blocks of the enemy base, so a raid that starts closer walks.
The raider lands 24 blocks outside the base, beyond the 16 blocks at which a raider gets spotted. It picks the point farthest from where the defenders were last seen. Failing that, it picks the point farthest from the gates, and failing that, the one nearest home. It walks in from the edge nearest its landing, and from there the breach, the loot, the trap and the night work as usual. On the way out it leaves the way it came in, walks back to its landing spot and flies home from there. If it was spotted, it first runs 40 blocks clear of the base before pillaring up. If it’s short of blocks or rockets, it walks home.
A scout with the tactic flies one circuit instead of walking. It flies about 20 blocks above the ground, over the middle of the enemy’s sightings and the four points 32 blocks around it, recording what it sees below. Then it lands 40 blocks off on the side nearest home. The tactic changes neither a raid’s urgency nor its odds, and a raider without an elytra raids on foot as before.
Getting in
A raider that knows the base’s fence ring (all four of its gates) picks a way in, nearest first, falling back to the next kind when one fails:
- A tunnel (with the
block_thefttactic and at least a stone pickaxe), when the chest stands inside the ring. The raider stands outside the wall on the line through the chest, out of sight of the golems, and digs a staircase down. It runs a two-high tunnel under the wall and the yard to the chest’s column, cuts up through the one floor block under the chest and opens it from below. It leaves the same way, putting the floor block back and sealing the stair’s openings at ground level behind it. The wall stays whole, the golems never stir, and the door is never used. If the dig would cut into water, lava, gravel or something unbreakable, the raider moves its stand farther out. With no line left, it tries the other ways. - A gate, if one still stands, nothing living stands in its doorway and its approaches aren’t too deep. The raider opens it with its own click, walks through and leaves it open. Raids never shut a gate behind them.
- A gap, where a post is already missing.
- Block theft (with the
block_thefttactic). The raider breaks one fence post or gate by hand with a pickaxe and pockets it. It never breaks a second post, a wall, a torch, a bush or a chest, and it leaves the dirt under the post. A ring with no gate, nowhere to steal and no pearl to throw stops the raid cold. - An ender pearl (with the
ender_pearltactic). The raider stands still, picks a landing cell inside the yard, aims a real vanilla throw at it and teleports in. Pearls cost health, so it won’t throw one when its health is too low.
A cobblestone fortress is breached the same way, with its doors
standing in for the gates. A raider opens a door it knows and walks through, or, with block_theft, breaks one
door (never the stone). The wall has no gaps, a pearl has to clear its overhang, and the tunnel goes under it
like under any ring. A raider learns a fortress’s doors as gates from the reveal cheat, not yet from scouting.
It leaves the way it came, back through the same gate or gap, then heads home. After a pearl entry it leaves by a gate or gap it can reach. If there’s none, it throws a second pearl out, and if it can’t do that either, it stands there and the raid fails.
A raider with the ender_pearl tactic hunts endermen for the pearls it keeps (two, always in hand rather than
in its chests).
Potions on the way in
A raider whose play style lists the potions tactic drinks on its approach once it’s within 48 blocks of the enemy
base’s edge:
- Swiftness first, so it gets in and out faster.
- Invisibility next, when the style also lists the
invisibilitytactic and the bot wears no armor. Invisibility hides the body but not worn armor, so a style can also addstrip_for_invisibility. The raider then takes off all its armor into its inventory before drinking and slips in unseen. It puts the armor back on as soon as it leaves the chest (or if a fight breaks out or the raid is spotted).
An unarmored invisible raider is much harder to spot. Defenders only notice it within 8 blocks, a range that grows with each armor piece it wears, up to the normal 16 blocks in a full set. See The Nether for how bots brew their potion stock.
The TNT trap
With the tnt_trap tactic, and one TNT and one stone pressure plate in its pockets, a raider traps the chest it
looted. It digs the floor block in front of the chest, sets the TNT in the hole, pockets the dug block and lays
the plate flush with the floor. The next player or mob to step up to the chest presses the plate, and vanilla’s
TNT does the rest, usually taking the chest and whatever is left in it along with it. The raider never lights
anything itself. A raider that came in through a tunnel never stood in the yard, so it lays no trap.
When the chest stands inside a building (or the floor in front of it isn’t diggable), the trap goes just inside the enemy’s gate nearest the chest instead. If that doesn’t work either, no trap is laid. The raider also skips the trap while an ally, a faction mate, a villager or a friendly player-built golem stands within 8 blocks. If a protection mod refuses the placement, only the trap fails and the loot still goes home.
The raider’s faction records where the trap lies, and its bots walk around the plate from then on. Other bots (including the victims’) don’t know about it.
Check your chests after a raid
If an enemy faction has been in your base, don’t walk straight up to the emptied chest. There may be a pressure plate on the floor in front of it, or just inside your gate.
Being spotted
A bot on a raid never picks a fight. It raids when nobody is looking and runs when someone is. A raid gets spotted when an enemy within 16 blocks (8 for an unarmored invisible raider) keeps the raider in its field of view for a second. The raider has to see that enemy too, so one watching from behind its back never notices it. Any enemy hitting the raider also spots the raid, and so does an enemy coming into sight whose gear outmatches the raider’s side.
Once spotted, the raid breaks off whatever its phase, with whatever loot was taken. The raider sprints out the way it came in and keeps running past enemies it would normally keep its distance from, until it’s clear of the base. It fights back only when cornered, or when an attacker hit it and its own side outweighs that attacker. Home with the loot, it doesn’t turn around.
A spotted raid writes the spotter’s gear weight to the base’s record as its guard. The next raids’ odds count that defender even after it’s gone, and the whole raiding faction leaves the base alone for ten minutes.
The counter-raid
A bot base that gets robbed notices and strikes back. Its bots pick up on a theft from four signs as they go about their work:
- One of its recorded chests holds fewer of something than last time, and no owner took it.
- The storehouse’s decoy chest was opened.
- The decoy’s TNT went off.
- An enemy seen inside the yard walks out of it holding something valuable of a kind the base keeps.
The base records the theft with what’s missing, the thief and the thief’s faction. The thief is a player seen with that chest open, or else the freshest enemy sighting within 32 blocks of the base. While a theft names a thief from an enemy faction:
- Every bot of that base fights the thief on sight, whatever its play style’s aggression and the gear odds, and hunts it before any other enemy.
- Any bot of the base scouts the thief’s faction’s sightings first, until that faction’s base is confirmed.
- Any bot of the robbed base raids that confirmed base back before any other, whether or not its style raids.
The counter-raid scores at twice the style’s
raidweight (1 for a style with none). It takes everything the bot can carry instead of leaving slots free, and goes on from chest to chest while it has room. The usual rules still hold: the odds,pvpon, no active order, enough health.
The theft is forgotten a day after its first counter-raid sets out, or three days later if nobody answered. A second theft in the meantime is added to it and has to be answered again. A theft that names no enemy faction (an operator’s own take, or a neutral’s) is kept, but nobody acts on it. A counter-raid never touches a player’s buildings.
Defending against raids
- Don’t be at war unless you mean it. Raids need an
enemyrelation, and they needpvpon. - Stay unseen. Only a confirmed base gets raided, and bots confirm a base by watching it, so a base nobody is seen using never makes the list. The hidden base style takes this all the way. Nothing of it stands in the open, so an enemy finds it only by following its owner in.
- Be there. A raider that gets spotted flees, and its faction leaves your base alone for ten minutes with your gear weight on record as the guard. Raids come at night, so that’s when it counts.
- Walls help, but watch the gates and the ground. A ring funnels raiders to your four gates, and berry
bushes slow whatever walks at them. A fortress wall stops
climbers, and a lava moat burns what comes at its foot. Still, a
gate or a door opens by hand,
block_theftand pearls exist, and a raider with a pickaxe tunnels right under all of it. Player-built iron golems never attack players or bots (that’s vanilla’s own rule), so they only guard against mobs. See Base defenses. - Set a decoy. A trapped decoy chest over TNT in the storehouse is the last chest a raider opens as it works through them, and it lights the TNT under the raider’s feet.
- Use a protection mod. Bots break and open blocks the same way players do, so claims stop a raid dead. A refused chest fails the raid.
- Keep your valuables on you or in barrels and ender chests. Only plain chests and shulker boxes get looted, and a box is carried off whole. A modded machine in a bot base’s yard is carried off too.
- Expect retaliation. Rob a bot base yourself and, if your faction is its enemy, its bots come after you and your chests (the counter-raid). Rob it as a neutral in front of its bots and you earn a grudge.
Technical details
Turning raiding on in a play style
"weights": { "raid": 1.5 },"nether": { "travel": true, "spare_obsidian": 0, "potions": { "minecraft:swiftness": 2, "minecraft:invisibility": 2 }},"tactics": ["chest_raid", "block_theft", "ender_pearl", "tnt_trap", "potions", "invisibility", "elytra"]chest_raidturns on the Overworldscoutandraidobjectives.block_theftadds the tunnel and the stolen post,ender_pearlthe pearl throw andtnt_trapthe trap.potionslets the bot drink Swiftness and Invisibility on the approach.invisibilitydrinks Invisibility when unarmored, andstrip_for_invisibilitytakes worn armor off before drinking and re-equips it when leaving the chest or when spotted.elytrahas a raider that holds an elytra fly its way in and out, and a scout fly its circuit (by air). An unknown tactic fails the file.weights.raidweightsscout,raidand the Nether’sloot_bastion. Bothraidandloot_bastionare off unless the style lists that weight, so tactics without the weight scout but never raid, andweights.raidwithoutchest_raidonly loots bastions in the Nether (like the Boomer).- A style with
ender_pearlkeeps two pearls in hand (gather_pearls) and hunts endermen for them. A style withtnt_trapkeeps one TNT and one stone pressure plate (gather_trap). The TNT is crafted from five gunpowder (a creeper hunt with a bow) and four sand, the plate from two stone. - See Play style files.
How enemy base knowledge is kept
Each bot keeps up to 4 enemy base records and shares them with its faction, which keeps up to 8. A block seen more than 48 from a faction’s known center is dropped instead of becoming a second base. Bounds are the attributed blocks grown by 4 on every side. Blocks seen with nobody about only join a confirmed base (inside its bounds grown by 8), so a scout fills in a base over several visits. A record is forgotten when a visit within 16 of its center finds none of its chests, beds or gates standing, when the faction is dissolved or becomes an ally, or one in-game day after it was last seen. Suspected bases are due for a watch right away, then every 2400 ticks. Three empty watches in a row drop them, and a watch cut short by a fight counts for nothing. Attribution reads at most 64 columns a second and is shared by faction mates looking at the same enemy.
How a raid is chosen, and its cooldowns
Urgency is 0.6 × the record’s freshness (1 when last seen, 0 a day later). The scout’s search is 0.4 ×
the freshness of the faction’s best sighting, and its watch a flat 0.3. A raid needs the pvp game rule,
health above retreat_below_health + 0.1, 8 free slots, and a guard the bot’s kit (boosted by its
aggression, as in the gear comparison) reaches. The guard is the weight of that faction’s freshest
sighting within 32 of the base, with golems counting for nothing. For a base that spotted a raider, it’s at
least the recorded guard. Cooldowns: a chest that can’t be reached rests 600 ticks, a chest refused by a mod
and a base with no way in rest 6000, an emptied chest rests a full in-game day even if it’s restocked right
after, and a base that spotted a raider rests 12000 for the whole faction. stow scores 0 while a raid
runs, so the loot isn’t dropped off halfway. Dusk is day time 12000 and dawn 23000. “A day’s walk” is a
player’s walking speed over a day, about 5180 blocks. A raid forced with debug objective raid never waits.
A raid that sets out also calls the faction: each bot that
comes raids the same base with a run of its own.
The tunnel in detail
The tunnel runs straight in from the ring side nearest the raider, on the line through the target chest (any
chest inside the yard, in a storehouse or not). The stand is the first column outward whose stair (four steps
on level ground, three to six on a slope) ends two columns clear of the ring. It’s at most 24 columns out and
more than 16 blocks across the ground from every player-built golem in sight. The run goes four blocks under
the chest’s feet. The only building block ever broken is the floor cell under the chest, which is put back on
the way out (with the floor’s own block when held). A raider that knows fewer than four gates tunnels too,
with the nearest known gate fixing that side of the ring. The dig runs under the raid’s allowance for the
ground beneath the ring, the yard and the base’s buildings, so a protection mod still has the last word. A
wooden pickaxe breaks a post but digs no tunnel. A yard over a cave or near bedrock breaks the line, and then
the raid falls back to the post rules. The task path reads ... > enter > breach by tunnel > allowed tunnel > sequence > dig stair (2 cut) on the way in and ... > way out by tunnel > ... > put back 1/1, then ... > seal 1/3, on
the way out.
The pearl throw
The landing cell is inside the yard, within 24 blocks across and 8 up or down, the farther the better
short of the yard’s far side. A level throw from standing height carries about 14 blocks, and a near
landing over a fence needs a steep arc. The pitch is found by simulating vanilla’s own flight (speed,
gravity and drag) against the blocks in the way, so an arc a post would stop is passed over. The aim is
good to a block and a half, and vanilla’s throw spread adds up to two more at the far end. The pearl goes
from the hotbar and the bot waits up to 3 seconds for the teleport. A throw that lands outside is tried
once more at another cell. A pearl costs 5 health, so none is thrown below retreat_below_health + 0.25.
The spotted rule in detail
A raid is spotted when a living enemy within 16 blocks holds the raider within 30 degrees of its view direction for 20 ticks in a row (the raider must see that enemy too), when any enemy hits the raider, or when an enemy in sight outweighs the raider’s side by the gear comparison. On a raid, a bot picks no fights at all, not even against a weaker enemy on sight. It fights back only when cornered (the attacker within 2 blocks) or when its side outweighs the attacker, and the raid resumes after such a fight. The way out is held for 32 blocks. Beyond that the bot flees like any other and finishes the way home after. The spotter’s weight becomes the record’s guard floor for the record’s whole life.
What info shows
enemy bases: Reds at (120, 64, -30), 3 chests, 4 gates, 2 golems, trap at (118, 64, -27), guard 2.9 (seen 4 min ago)enemy bases: Blues (suspected) at (-40, 70, 12), 1 chests, 0 gates, 0 golems (seen 30 s ago)objective: raid (score 0.90), raid: reds loot via gate, spotted by Annobjective: raid (score 0.90), raid: reds approach (flying)objective: scout (score 0.40), scout: reds (flying)The enemy bases: line lists what the faction knows, with (suspected) on an unconfirmed record, the
traps it laid there and the guard that spotted a raid. The objective line names the raid’s phase
(prepare while it waits for dusk, then approach, enter, loot, trap, leave), the way in once the
breach chose it (tunnel, gate, gap, theft or pearl), (flying) while a raider or a scout with the
elytra tactic is in the air, and who spotted the raid.
/aiplayer info <bot> enemy bases lists each record with its chests (and their contents, where a raid or the
cheat read them) and its gates.
Operator commands
/aiplayer debug <bot> objective scout one scouting trip or watch/aiplayer debug <bot> objective raid one raid against the freshest confirmed base, whatever the odds, at once (no waiting for dusk)/aiplayer debug <bot> task pearl <x> <y> <z> throw a held ender pearl at that cell/aiplayer debug <bot> task trap lay a TNT trap at the nearest chest from what the bot holdsKnown limits
- Only plain chests, shulker boxes and the machines of a bot base’s yard are raided. Barrels, hoppers and ender chests are never opened or looted.
- Attacks need ENEMY faction relations, so a grudge target’s base is never learned and a factionless player is never raided.
- An enemy seen only passing through its own base (never opening a chest there, sleeping there or seen at home three times) stays suspected and unraidable.
- A guard weight stays on a record until it’s forgotten, even long after that defender has left.
- A pearl entry needs room: a yard shallower than about 12 blocks is never pearled into.
- Golems count for nothing in a base’s guard, and player-built golems never attack players or bots, so they slow mobs but not raiders.
- A bot doesn’t know about traps laid in its own base. Only the faction that laid them walks around the plate (the exception is its own decoy, which it does walk around).
- A scout doesn’t yet learn a fortress’s doors as gates from sight. Only the reveal cheat records them, so a raider that has only scouted a fortress walks through its doors but doesn’t know them as its way in.
- A hidden base is never raided through its sealed tunnel. For now it’s only found by following the owner.
- A theft is noticed only by the base in its home dimension, never by a Nether camp, and a take by a hopper or an operator reads as a theft against nobody.
Last updated Nov 9, 2026