Spawner protection
Spawner protection is a denial macro rather than a defensive one. A bot waits at your spawners, and the moment a player you haven't listed comes into view, it mines every spawner within reach and logs out. It's for getting your spawners into the bot's inventory before a raider can take them. Our official macro, Spawner protect, does exactly this on DonutSMP and HugoSMP bases, and you can build your own for any server.
What you need
- Tier 3. Player appears is a Tier 3 event, and the loop that goes through the spawners is Tier 3 logic.
- A pickaxe in the hotbar. The bot switches to it the way pressing a number key does, so a pickaxe in the main inventory isn't found.
- The account parked among the spawners. Nothing in the macro walks, and a click reaches only as far as a player's arm, so the bot mines what it can reach from where it stands.
- A server that lets you mine spawners. The macro really breaks them, and what a mined spawner drops is up to the server: in plain Minecraft it drops nothing. Use it only where losing the placed blocks is the outcome you want.
Build the macro
- Visit minecraftafk.com/dashboard/servers/, open the server profile, and open its Macros page.
- Click Create macro, click the event card and pick Player appears under Runs when. Add your friends under Never fire for these players, and leave Ignore my own accounts ticked so your other bots never set it off.
- Click Add step and pick Hold item. Under Item source pick Specific item, then pick your pickaxe.
- Add a For each step. Under For each pick Block nearby, pick the spawner under Block, and set Within (blocks), such as 5.
- Between For each and End for each, add a Look at variable step, which comes pointed at the loop's variable, and then a Left click once step.
- After End for each, add a Panic logout step.
- Pick the accounts it runs on and click Create macro at the top right.
The loop goes through the spawners it finds nearest first, and each left click holds the flow until its spawner has finished breaking, so they go one at a time. The list is read once, when the loop starts, and holds 100 spawners at most.
Or add the official macro
Spawner protect is ours, built for DonutSMP and HugoSMP. When a player you haven't listed comes into view, it turns to the nearest player, switches to your pickaxe and crouches. Then it mines the spawners within 5 blocks one after another, nearest first, pausing a moment after each break and checking again until none is left, and ends with a panic logout. It gives up after 30 tries, so a spawner it can't reach or can't break never keeps it from logging out.
- Visit minecraftafk.com/dashboard/servers/, open the server profile, and open its Macros page.
- Find Spawner protect in the Macro library and click Add.
- Under Settings, tick the accounts it Runs on, then fill in:
- Pickaxe: what breaks the spawners, a netherite pickaxe to begin with.
- Break spawners within: from 1 to 5 blocks, 5 to begin with. A click reaches about 4.5 blocks and the bot doesn't walk, so nothing farther can be broken.
- Players to ignore: friends who should never set it off. Your own accounts are skipped automatically.
- Click Next, read What it does and Before it runs, then click Add macro.
It needs Tier 3, and it lands switched on, watching from that moment. On Tier 3, a DonutSMP or HugoSMP profile made with its ready-made setup already has it, switched off: click it, fill in Players to ignore, then switch it on. Macro library and sharing covers the official macros and how we keep them up to date.
Keep it safe
- Who sets it off. Your own accounts never do, unless you untick Ignore my own accounts in a macro of your own. Name everyone else who may walk up: under Players to ignore on the official macro, or Never fire for these players on yours.
- Narrowing your own. Or names matching leaves out a whole family of names with a pattern, and Only within (blocks) waits until a player comes that close, up to 32 blocks. Left empty, it reacts anywhere the bot can see.
- It logs out where it stands. Panic logout turns the head a few times and leaves without taking a step, and the account stays off.
- Starting again. The panic logout also stops the macro on that account, so the base is unguarded until you bring it back. Once the player has gone, press Reconnect in the macro's Stop condition column on the Macros page, or Stopped by macro on the Connect page: either brings the account back and starts the macro again. See Starting again after a stop.
- Hear about it. In a macro of your own, a Notify my devices or Discord webhook step before the Panic logout tells you it went off. See Push notifications and Discord webhooks.
Good to know
- It goes off for a player who is already there. Player appears also fires the moment the macro starts if a player is in view already: when the account joins, when you switch the macro on, and when you reconnect it. In your own macro that's the Also fire if they are already nearby box, ticked to begin with.
- Smart trigger. With Smart trigger ticked, as it is to begin with, Player appears holds back for 5 seconds after the bot is teleported, and while 5 or more other players are in sight at once, since both usually mean a hub or spawn. So a group of five or more that comes into view together doesn't set it off. Untick it in your own macro to have it fire for every player. The official macro keeps it ticked: make an editable copy, from its row's ⋮ menu, to change that.
- Keep the account at the spawners. A join macro that moves it, such as an
/afkhop or a/home, takes it out of reach. The macro then finds nothing to mine, and just logs out when a player appears. - Shards and stars. DonutSMP pays shards anywhere on the server, so a bot guarding your base still earns them. HugoSMP pays stars only in its AFK zone, which a bot at your base isn't in.
- Don't only AFK. A guard account that never does anything else is the kind both servers are known to ban. See Can I get banned for only AFKing?
For each and Panic logout in the macros guide have the details of the two steps it's built on, and Stop conditions the other ways to stand a macro down.
Auto sell
Sell what your Minecraft bots collect while you're away, with the official Sell axe and Sell menu macros for DonutSMP and HugoSMP, or a sell loop you build yourself.
PvP
Have your Minecraft bots guard you or your base: when a player you haven't listed comes close, each bot turns to the nearest one and fights.