The mine
The bot digs one mine, under its own shelter, to a fixed plan. The map below walks through the plan a part at a time. The written guide under it says the same in words.
The stairs
- A diagonal staircase goes down from the shelter's back wall: one block forward and one down per step, 5 blocks high, so a stair block fits on each step. Near the surface the steps are lower (down to 3 high), so at least two blocks of ground stay over them. The stairs never open to the sky.
- Every step is a closed tube: floor, both side walls and a roof are kept solid. Where the stairs cross a cave, the gaps are filled with dirt or cobblestone.
- The stairs come first. Every trip starts by checking every step's floor, walls and roof and filling what's open. With stairs still open after a second try, there is no mining below them that trip.
- The way into the mine is by the shelter and down the stairs, never a shaft dug down from the grass.
- If the stairs are blown apart or filled in while the bot is below, it puts them back as planned from where it stands, a step at a time upward.
- Once it owns 200 cobblestone, the steps get cobblestone stair blocks.
- Blocked going down by water, lava, something built or a drop it can't floor, the stairs turn: right, then left.
- The stairs go down to just over bedrock. No floor is below y -54.
Floors
The first floor is 20 steps down. After that there is a floor every 10 blocks deeper.
- The room is 3 by 3 and 3 high, ahead of the stairs' end. The stairs end in the middle of its back side, so its middle stays free to walk from sleeve to sleeve. The stairs to the next floor cross the room flat and go on from its front side.
- Four sleeves leave the room. The left and right ones leave from its middle line. The back one runs along its left row, beside the stairs; the forward one along its right row.
- Every sleeve is 50 blocks long, 1 wide and 3 high. They are dug in this order: forward, right, left, back.
- Iron first. Once one sleeve of a floor is done, if the bot is still short of iron for an iron pickaxe and an iron sword, or has under 32 coal, it goes on down to the next floor instead of the floor's other sleeves. With enough of both, every floor is finished in order.
- A sign on the room's right wall names the floor: "1st floor", "2nd floor".
- A crafting table stands in the room's front-left corner and a furnace in its back-right corner, under the sign. The bot crafts and smelts down there instead of walking home.
Pokeholes
Along every sleeve, every 3 blocks, there is a pokehole on both sides: 1 wide, 3 high, 5 long. Pokeholes show the rock between the sleeves, so the bot finds far more ore for the same digging.
Every tunnel, sleeve or pokehole, is dug from inside itself: the bot steps back into the last block it dug and digs the next column from there. No ordinary walk breaks a wall, floor or ceiling block of the mine. Only reaching ore it can see may dig through a wall. Afterwards the floor of the sleeves and the room is mended, a block per hole. Pokeholes and roofs are never restored.
Ore
- Ore is mined as it's uncovered. After each column of a sleeve or pokehole is dug, every ore block touching it and the vein behind it (up to 8 blocks, within reach) is mined standing in the tunnel. A hole in the floor is filled at once.
- Ore its pickaxe can't mine yet, such as diamond with a stone pickaxe, is left. A later trip takes it once the bot has a better pickaxe.
- Ore underground comes from the mine only. "Ore in the open" near its home means a face the sky lights, like a ravine or a cliff, never a dark cave it would have to dig down to.
Caves the tunnels meet
- A pokehole that meets a cave ends at that block, and the opening is filled with cobblestone. It counts as finished and the sleeve goes on.
- A sleeve crosses a short gap, under 7 blocks of cave, as a closed tube: the floor, both walls and the roof are built as it goes. At a big cave the sleeve ends at the cave's edge with its face plugged.
- Before plugging, ore it can see in the cave within reach is mined from inside the tunnel. It never steps into the cave.
- Every plug it puts in a cave's opening is remembered. Each trip puts back the ones that were broken.
- Caves that stay underground are otherwise left open. Only openings to the sky are sealed.
Water, lava and gravel
- The bot never breaks a block with water or lava at its sides or on top. Only the drowning reflex, digging up for air, may.
- Water or lava in the block a tunnel would dig next: the face is filled and that sleeve or pokehole ends there, marked blocked. It never pushes a tube through water.
- Water only in a wall beside the tunnel is plugged, and the tunnel goes on.
- Lava down in a gap: no bridge over it. The tunnel ends there.
- Gravel or sand that falls into a tunnel is dug out, nearest column first and from the top down. Gravel falling onto the bot's head is dug out at once by a reflex.
Closed to the outside
Where a room, sleeve, pokehole or the stairs open into air that reaches the sky, such as a canyon or a ravine, the opening is blocked with cobblestone. This is checked at the start of every trip and after every stretch it digs.
When it can't go deeper
With every way down blocked, or at the bottom, it digs side routes off its lowest floor's sleeves: every 3 blocks, 10 long.
Rules of every trip
- It goes down only with enough health (12 of 20 or more) and food.
- Hurt below 10 health in the mine, it ends the trip and climbs out by its stairs to heal.
- It leaves the mine by its own stairs, never by a new way dug up through the rock. From a floor's tunnels it walks back to that floor's room first, then up the stairs.
- A trip ends only for low food or a full bag. Dusk doesn't pull it out: down in its mine it is home for the night.
- Damaged rooms and sleeves are mended only under its feet. The stairs are the exception: their whole tube is kept, walls and roof included.
- Walled in. With no way anywhere for 2 minutes from one spot, for the next 5 minutes its walks may break the cobblestone and dirt it put down beside its own passages. Never its shelter's or mine's shell, and never with water or lava behind.
The numbers on this page are the ones in the bot's code, in src/skills/mine.ts.