Building an economy
Mining
How bots dig for ore, stay safe underground and work their way up to diamonds.
Every bot mines what it needs: stone for tools, coal for torches, iron for its first good pickaxe. Bots whose play style loves mining go further, digging proper mines and going after diamonds.
Why bots mine
A bot heads underground when:
- its next tool set, shield or armor needs an ore it doesn’t have yet (9 iron ingots for a shield plus an iron sword, axe and pickaxe; 8 diamonds for the diamond tool set; 24 iron or diamonds for a full armor set; 4 ancient debris per netherite upgrade);
- it knows an enchanting table and has pieces waiting to be enchanted, which take lapis lazuli (four per piece);
- its play style wants a hoard of something, like the Boomer’s diamonds and netherite ingots or the Turtler’s 72 iron ingots for its golems.
It always checks its chests (and its furnace) first, since there’s no point mining iron that’s already in storage.
Once its shelter stands, from dawn until mid-afternoon, a bot whose tools, shield or iron armor still want iron it
doesn’t hold spends the daylight in the cave or the mine, ahead of the day’s other errands (the bed’s wool, the
bow’s string, the herd) and behind fetching food. Iron it has seen on the wall of a cave within 48 blocks it walks
to and mines without digging toward it.
If its play style lists diamond before iron in mining.ores, a bot on stone tools mines iron first, until it holds
the iron pickaxe needed to break diamond ore. Each tier’s pickaxe comes first. The bot smelts and crafts it from
three of that tier’s ore as soon as it holds them, wherever it stands, and the sword and the axe follow from the
rest. A trading bot that knows a smith selling the piece it wants buys it instead of digging for it
(trading up).
Three ways to dig
| Method | How it works | Used by |
|---|---|---|
| Strip mining | Digs a spiral staircase down to the best height for the ore it wants, then a long tunnel that turns every so often, grabbing every useful ore it passes. | Boomer (which looks for its iron in a cave by day, cave_by_day), and cave miners at night or when no cave is found |
| Branch mining | Like strip mining, with short side branches every few blocks to see more ore. | Custom play styles |
| Cave mining | Looks for caves and exposed ore, walks there, lights the area and mines what’s visible. It only chips through rock toward ore it can see within four blocks, never toward ore it only knows is there, but it digs down or across into a cave it can’t walk into when ore shows on its wall within 32 blocks, and pillars up to four blocks to ore high up a cave wall. It follows a cave it has found from pocket to pocket, lighting each, and leaves in time to be home by dusk. Falls back to a strip mine for the rest of the day if no cave is nearby or it can’t reach any it finds, and digs a dedicated night strip mine inside its lit yard from dusk to dawn. | Rusher, Turtler, Flanker |
A bot without a mining strategy (Neutral) still mines ore when it needs it, by digging down to ore within its
perception radius. Every bot also grabs ore exposed on an open cliff face as it walks past.
Following the vein
When a bot breaks a listed ore, it takes the whole vein. That’s every ore of a listed kind touching it by a face, and every ore touching those (ceiling and floor included), up to 32 blocks each time the tunnel moves on. It mines each one from where it stands or from the tunnel’s next step. For ore deeper in the wall, it cuts a short side passage toward it under the tunnel’s own safety rules, and leaves the ore if the cut is refused. It never mines a block from straight above it or the floor of its own walkway, and it leaves any ore with water or lava against a face. A vein that runs into lava stops at the ore beside the lava, which stays put and keeps the lava in. Once the vein is done, the bot walks back to the tunnel, picks up the drops and goes on. A dig for one ore outside a mine (a cave miner’s visit, or a tool’s ore from a cliff face) takes the whole vein the same way.
Crossing and descending deep caves
Real terrain is full of caves, and a miner’s staircase has a few ways to get past them:
- Bridging gaps: if the staircase breaks into a cave that’s at most 16 blocks across, it bridges straight across at the step’s height using blocks from its inventory (placing each block one ahead of its feet) and continues the staircase on the far side. The bridge becomes part of the mine, as the way back. A strip tunnel crosses a gap the same way, and a strip or branch miner keeps 16 blocks in its pockets for this.
- Cutting down the cave wall: if the cave is wider and deeper than a 3-block step-down, the miner walks out to the nearest rim and cuts a staircase along the cave’s rock wall down to the floor.
- Water landings and pillaring down: if the cave roof overhangs with no wall in reach, the miner drops into a water pool at the bottom if one is directly below. Otherwise it pillars down from the edge, crouching at the rim to place blocks below its feet (up to 12 blocks) and breaking them as it descends so nothing is left behind.
- Turning along the rim: when none of that works, the stair turns clockwise at the depth it reached and runs level along the cave’s roof or edge for up to 32 blocks, until a step down lands on rock. The mine only ends when every direction fails.
Safety first
Bots are careful underground:
- They never open a block next to lava or water, dig into an unguarded drop or dig into bedrock. They turn the tunnel instead.
- With a water bucket (in the Overworld), they can get through lava. From a safe stand the bot pours water beside or over the lava, waits for it to turn to obsidian or cobblestone, scoops the water back up and cuts through (at most three times per section).
- If water or lava does reach their tunnel, they seal it with cobblestone.
- They never dig the block they’re standing on (except while stepping down a temporary pillar they placed underneath first).
- They place a torch every 8 blocks.
- Underwater, they come up for air before it runs out, and they leave ore under water or next to lava alone.
- Their trap detector knows their own tunnels and mines aren’t traps, so they don’t panic in a 1-wide shaft they just cut.
Worn tools, spare pickaxes and the miner’s kit
An experienced miner doesn’t wait for a pickaxe to snap in the dark:
- Replacing worn tools early: any pickaxe, sword, axe, shield or bow below 10% durability counts as missing, so the bot crafts a replacement before the old one breaks (and keeps using the worn one until it’s gone).
- A spare pickaxe: once a miner holds its tier’s sword, axe and pickaxe, it crafts one spare pickaxe of that tier and keeps it in its pockets or in the mine chest at the top of the shaft. If a pickaxe breaks mid-tunnel, it swaps the spare in and keeps digging.
- The miner’s kit: before heading down for a strip or branch section, a miner makes sure it carries at least 16 sticks, 8 planks, 8 torches and a crafting table of its own (made from four more planks when it has none), so a pickaxe that breaks at night finds a table in its pockets. A style that fights with a sword or axe and has no shield yet carries six more planks, so the shield is made at the face from its first ingot after the pickaxe’s. If it needs a new stone pickaxe or crafting table deep underground, it crafts it at the tunnel face instead of hiking back to the surface, and with cobblestone and sticks but no table and no wood it walks up its own stair to a table within 48 blocks rather than wait for morning. A miner out of torches with coal and a stick in hand makes four more at the face, so its tunnel stays lit however far it runs.
- Cobwebs are string: a miner with a sword cuts every cobweb it sees within 8 blocks of its tunnel (with the sword, never shears) and keeps the string for its bow or its bed. A cave miner does the same on its way through an abandoned mineshaft, though it never goes to one on purpose.
- Topped up before dark: in the last two minutes of the day, a miner whose kit is short fetches what’s missing once (from its chests or nearby logs), a spare stone pickaxe included while it holds fewer than two pickaxes, so a pickaxe that breaks in the night finds a spare, sticks, planks and a table in hand. At night it makes the kit only from what it holds, where it stands, and never walks out of the night’s safe ground for it.
- At night, no spare: a miner with a home doesn’t go back for its spare at night while it still holds a pickaxe of that tier, however worn. When that one breaks at the face, it makes the next one there from the cobblestone and sticks it carries (an iron one when it has three iron ingots in hand). The spare is made by day.
A mine to come back to, day and night
A bot remembers its mine across fights, meals and server restarts. On Normal, Hard and Expert difficulties, a sheltered miner works right through the night inside its mine. Wild caves aren’t safe at night, so a cave miner keeps a second remembered mine (a night strip mine starting inside its lit yard) and digs that from dusk to dawn before returning to its caves in the morning. A strip or branch miner whose mine lies far from the yard, or that has none yet, does the same. A night’s mine it can’t walk to is left for that night, and a night strip is dug in the yard instead, rather than the bot staying in till dawn. A miner that gets a new pickaxe at night keeps mining through the night for the ore that pickaxe opens up (diamond for an iron one), and makes the rest of the set by day.
A base keeps one shaft. A miner goes back down the deepest staircase it has dug (its day mine’s, the one it kept, or its night strip’s) rather than a shallower one or a new one, and a cave miner’s night goes back down the shaft its day cave replaced. A cave miner that fell back to a strip looks for a cave again the next morning, and once the strip’s staircase reaches the ore’s depth it looks for caves round the foot and mines those first.
When its inventory fills up, a miner drops its finds in the chest at the top of the mine and throws away worthless rubble (dirt, gravel, granite, netherrack and the like) so it can keep going.
A mine from the burrow
A bot with no house yet doesn’t waste its nights either. If it’s sealed in its night burrow with a pickaxe (a wooden one digs for coal and keeps the stone it cuts for the morning’s tools), on a difficulty that works the night, and its style mines, it mines from the burrow. The burrow’s floor is the top of the shaft. A staircase winds down from there to the depth of the ore it needs, read from its pickaxe (a stone pickaxe digs for iron even before the stone axe is made). A strip tunnel runs from the bottom, lit with the torches it carries, until dawn. Everything stays under the burrow’s seal, so there’s no chest and no restocking. A drop under the stair is crossed on a bridge or turned along the cave’s edge, but the bot never goes down it.
Before it burrows, it makes sure it can replace its pickaxe down there (sticks and a crafting table from the wood it
holds). A pickaxe that breaks in the tunnel is remade on the spot from the stone it cut. With the three raw iron its
next pickaxe needs, a fuel and eight cobblestone, it even smelts them in the mine and makes the iron pickaxe there
(four ore, when it holds a fourth for its shield), and a bot that already holds the three ingots makes the pickaxe
at its face before it digs on, not once its stone one breaks.
If a fight pulls it out of the tunnel, it digs back to the face afterwards and keeps mining. At dawn it walks
back up its stair and climbs out, and the mine is its mine from then on (info shows it as mine: strip at the
burrow’s floor).
A bot that already has a mine of its own in reach at dusk doesn’t dig a burrow at all. It goes down to the mine’s face, closes the way behind it with a couple of blocks and mines on from there through the night. If something sends it out of its mine later in the night (it got chased out, or it’s back from elsewhere), it walks back and digs down to the face again.
Smelting: the furnace is a job
A player loads the furnace, goes off, and comes back when it’s done. So does a bot:
- Long smelts are loaded and left. A smelt of more than three items goes in with its fuel. The bot remembers the furnace and when it will be done, and goes back to its mine or whatever else is worth doing. When the furnace is due, it comes back (by day, off duty, with nothing to fight, from up to 96 blocks away) and takes the result. It refuels a furnace that went out, loads the next batch of the same ore it carries and leaves again. A short smelt of three items or fewer is waited out at the furnace.
- A furnace passed is emptied. A bot walking within reach of one of its own furnaces with something cooked in it takes it on the way, unless it’s fighting, fleeing or has no room for it.
- A smelt loads the whole stack. A smelt a plan asks for (three raw iron for a pickaxe) loads every raw ore or raw food of that kind the bot holds, up to a stack and as much as its fuel cooks. It waits only for what the plan needs, takes that out and leaves the rest burning, to collect later like any furnace of its own. Down a tunnel, a furnace standing in the walkway keeps to the plan’s count so it never blocks the way. Raw meat or fish goes in before any ore, and a furnace of someone else’s that’s busy is left alone for five minutes.
- Raw ore never stays raw overnight. A bot carrying raw iron, gold or copper and something to burn loads it into a furnace unasked. It loads eight or more of one ore whenever it passes its furnace empty, any amount at dusk (iron first, whatever wants it), and by day, between its other jobs, three ore or more (or any raw meat) at a low urgency, as a player smelts what it brought back before it sets out again. Ore that its next tools, shield, armor or hoard still need is left for the plan that wants it, except iron once the iron pickaxe is held.
- The next pickaxe’s ore is smelted on the spot. A bot climbing to iron (or copper) with no pickaxe of that tier yet smelts the three raw ore it takes right away, as long as it has something to burn. That happens day or night, down its mine as well as at home. It uses a furnace it carries, or its own furnace when it’s within 48 blocks on the same level, or else crafts one from eight cobblestone with a table it carries or makes from its planks. It never walks up a flight of stairs to the surface for this. A bot with no wood for a table walks to its own furnace or table in its yard or its mine instead, by day or night.
- Big batches use more furnaces. With more than a stack to smelt and the cobblestone for more furnaces in hand, a bot burns the batch in up to three furnaces side by side, so it’s done in a third of the time.
- Down a one-wide tunnel, where there’s no free cell beside the bot, the furnace (like the crafting table) goes into a notch cut in the side wall and stays there while it burns.
A bot keeps track of at most four furnaces at a time. Everything goes in and out of a furnace through its menu, by the bot’s own clicks.
In the Nether
When a bot travels to the Nether for ancient debris or nether gold ore (like the
Boomer), it starts a strip mine at its Nether camp’s doorstep, between the camp shelter and the portal. It digs a
staircase down to Y = 15 and keeps a wider safety margin around lava (nether.lava_margin, 2 blocks by default).
Once it has four ancient debris (or scrap) for a netherite ingot, it hauls them home through the portal to smelt and
upgrade its diamond gear at a smithing table.
The road to diamond and netherite
Bots climb the gear ladder in order: wood, stone, iron, then diamond, and finally (for styles with
gear_goal: "netherite") netherite. On each tier the pickaxe comes first, made from its own three ingots as soon as
they’re held, because it unlocks the next ore. Next comes the shield (on the iron tier, for sword and axe styles),
then the sword and the axe, with their ingots smelted as one furnace load. A tier counts as climbed once the sword
and axe are held too, and the armor follows the tier climbed. A bot with the iron tools makes and wears iron armor
and swaps it for diamond once it holds the diamond tools. It
enchants its diamond and netherite pieces at
its base’s enchanting corner, and upgrades to netherite piece by piece once it brings ancient debris and a bastion
smithing template home from the Nether. Once the ladder is
climbed and enchanted, a style that goes to the End has nothing left to gear for.
Technical details
Mining heights
A strip or branch mine digs down to the height where the ore is richest:
| Ore | Y level | Dimension |
|---|---|---|
| Coal | 96 | Overworld |
| Copper | 48 | Overworld |
| Iron | 16 | Overworld |
| Lapis | 0 | Overworld |
| Gold | −16 | Overworld |
| Redstone | −58 | Overworld |
| Diamond | −58 | Overworld |
| Ancient debris | 15 | Nether |
The staircase is a square spiral, turning clockwise every 8 steps, starting at the bot’s feet or 4 blocks out from its house’s door (in the Nether, at the camp’s doorstep), and it stops one block above bedrock. The tunnel is 1 wide and 2 high, in legs of 64, 64, 128, 128… blocks with clockwise turns. A branch mine adds a 12-block branch to each side every 3 blocks. A cave mine walks to ore with an air face below the surface, or to a dark pocket, lights a 5×3×5 box and mines what its walls show. If no cave or exposed ore is found, it falls back to a strip mine for that ore.
Mining settings in the play style
"hoard": { "minecraft:diamond": 8 },"mining": { "strategy": "strip", "cave_by_day": true, "ores": ["#c:ores/diamond", "#c:ores/iron", "#c:ores/gold", "minecraft:ancient_debris", "minecraft:nether_gold_ore"], "ore_heights": { "#c:ores/tin": 20 }}strategy is strip, branch, cave or none. ores lists block ids or tags in order of preference. The
bot digs for the first one that a need names and its best pickaxe can break (in the current dimension).
cave_by_day (false by default, true for the Boomer) makes a strip or branch miner look for its iron in a cave
by day, keeping its own mine for the night and every other ore. ore_heights sets the height an ore is mined
at, by #tag or block id, over the defaults above. hoard takes a list (32 of each item) or a map of counts. Mining for the hoard counts at half the deficit, while mining
for the next tier’s tools and armor is weighted by the style’s gear weight. See
Play style files.
What gets thrown away
With a full inventory, a miner first fills its mine chest (including its spare pickaxe), then tosses cobbled deepslate, dirt, gravel, granite, diorite, andesite, tuff, netherrack beyond 32, and cobblestone beyond 32. A strip or branch miner keeps 16 blocks to bridge a cave with, using cobblestone, or the rest of the spoil except gravel when it’s short on cobblestone. A crafting table or furnace it placed in a tunnel (but not inside a house) is picked back up when it’s done.
Inspecting a mine
/aiplayer info <bot> shows the mine on its mine: line, for example
mine: strip at (x, y, z), face (x, y, z) east, 212 dug, for minecraft:diamond, and a cave miner’s night strip
on a night mine: line beside it. Operators can start a mining run with /aiplayer debug <bot> objective mine.
A mine that finds nowhere left to dig is forgotten, and the next one starts fresh. info names each side’s
refusal, the ways down a cave and the turns along its rim it tried. A cave miner’s task line counts its luck:
cave mine iron (0 ore, 0 trips, 2 unreached, 2 failed, 640 idle). The third ore it can’t walk to, or 1200
ticks of cave mining that neither mined ore nor reached a dark pocket (or 600 ticks with no ore and nothing in
sight), ends the search with no cave reached, and the strip fallback takes over at once, info reading
fell back to the strip with the reason. An ore climbed to on a pillar shows as climb to.
Veins and furnaces in detail
- A vein’s ore is taken from the section’s stand, its next step or a short side passage (“drift”), level or one step down, cut under every rule of a section, at most 3 per ore and 8 per section. Ore more than two blocks above every stand is left. The 32-block cap is per section and counts the ore in reach of the walkway, and everything a section breaks (cuts, drifts and ore) counts toward the 128 blocks a mining trip digs before it ends. A fluid that reaches a vein’s hole is sealed with one cobblestone and ends the vein. After the vein the bot walks back to the section’s stand and collects drops for 60 ticks more.
- A long smelt (more than 600 ticks of cooking) ends as pending: the objective that needed the ingots is held
back until the furnace is due, and the planner counts the load as held. The collect comes after every danger
and before routine work (
survive[collect]in the logs), refuels at most three times over a job’s life (then takes the input back out), and forgets a furnace it can’t reach. At dusk, held ore goes into the remembered furnace within 48 blocks if it’s free, else one carried, else one crafted from eight cobblestone when a crafting table is at hand. This never happens during an order, a fight, a hunt or a raid. Thesmelt_oreobjective (info) is this dusk load. A fifth furnace job is refused (too many furnaces of the bot's own burning) until one is collected.
Modded ores
Modded iron and copper ores in the vanilla #minecraft:iron_ores and #minecraft:copper_ores tags are mined
for tools like vanilla ones. Every block tag under c:ores/ (the conventional tags mods put their ores in) is
an ore the bots know without any plugin: #c:ores/tin becomes the ore tin, mined with the lowest vanilla
pickaxe that gets its drops and giving what the block drops plus what that smelts into, so a hoard of the
mod’s ingot sends a miner after it. It’s mined at the bot’s own level unless the style’s mining.ore_heights
says where. A mod’s plugin can still register an ore itself for what the tag can’t say (its rung, its height,
its product, its dimension), and its entry then wins for those blocks (see
Mod integration).
Last updated Nov 10, 2026