Mining jobs.
Five built-in jobs cover most digging: strip, tunnel, ore, stairs and hole. Each takes one options table, keeps its fuel reserve, follows ore veins, unloads when full and comes back when done.
How jobs work.
Every job runs through the same wrapper as td.run. Before each block it keeps enough fuel to get back and empties a full inventory (see Where jobs unload). When it cannot, the job stops early, comes back and says why in the Console.
- Every job returns
truewhen it finished, orfalse, reasonwhen it stopped early. - A dig the server refuses or an unbreakable block is not a failure: a tunnel simply ends there, and a hole skips that spot and routes around it.
- Ore levels are for Minecraft 1.18 and later.
Strip mines.
A main tunnel straight ahead with side branches. Every spacing blocks it digs a branch of branch blocks to the left and one to the right, then carries on.
Returnstrue, or false, reason.
lengthnumberdefault 32Blocks of main tunnel to dig on this run.spacingnumber (min 1)default 3A pair of branches every this many blocks of main tunnel.branchnumberdefault 8Length of each branch, dug to the left and to the right, 1 high. 0 means no branches.height1 | 2 | 3default 1Tunnel height. At 3 the turtle climbs one block first and travels in the middle row.sidestrue | falsedefault trueAlso check the left and right walls at every block, for ore and for lava or water.veinstrue | falsedefault trueDig out ore veins the tunnel touches, then come back to the tunnel.torchesnumberdefault 0 (off)Place a torch every N blocks of main tunnel, in a one-block niche in the left wall. Needs torches on board.plugtrue | falsedefault trueWall off lava or water next to the tunnel with a junk block (cobblestone, dirt, stone and similar) from the inventory.resumefalseStart over instead of continuing an earlier run from the same spot. See Remembered progress.returnHometrue | falsedefault trueGo back to the return point (home, or where the job started) and unload afterwards.dropJunktrue | falsedefault falseWhen the inventory fills, drop junk blocks before unloading.
Tunnels.
A plain tunnel: a strip mine without branches.
Returnstrue, or false, reason.
lengthnumberdefault 32Blocks of main tunnel to dig on this run.height1 | 2 | 3default 1Tunnel height. At 3 the turtle climbs one block first and travels in the middle row.sidestrue | falsedefault trueAlso check the left and right walls at every block, for ore and for lava or water.veinstrue | falsedefault trueDig out ore veins the tunnel touches, then come back to the tunnel.torchesnumberdefault 0 (off)Place a torch every N blocks of main tunnel, in a one-block niche in the left wall. Needs torches on board.plugtrue | falsedefault trueWall off lava or water next to the tunnel with a junk block (cobblestone, dirt, stone and similar) from the inventory.resumefalseStart over instead of continuing an earlier run from the same spot. See Remembered progress.returnHometrue | falsedefault trueGo back to the return point (home, or where the job started) and unload afterwards.dropJunktrue | falsedefault falseWhen the inventory fills, drop junk blocks before unloading.
Mining for an ore.
Go to the best Y level for an ore, then strip mine there. It first digs two blocks forward, to keep the shaft clear of the start, then straight down (or up) to the level and turns back to its original heading.
Needs real coordinates: set up GPS or set the position by hand first.
Returnstrue, or false, reason. Raises an error for an unknown ore.
orestringA key oftd.ORE_LEVELS, e.g. "diamond".ynumberInstead of ore: the Y level to mine at....strip optionsEvery td.mine.strip option applies once there.
The best Y level per ore, used by td.mine.ore.
Staircases.
A walkable staircase, one block forward and one down (or up) per step.
Returnstrue, or false, reason.
direction"down" | "up"default "down"Which way the staircase goes.stepsnumberdefault 16Number of steps.toYnumberInstead of steps: go until this Y level (the step count is the height difference).headroom2 | 3default 3Clear space above each step. 3 digs one extra block so it is comfortable to walk.veinstrue | falsedefault trueDig out ore veins above and below each step.torchesnumberdefault 0 (off)A torch every N steps, in a niche in the left wall.plugtrue | falsedefault trueWall off lava or water above or below a step.returnHometrue | falsedefault trueGo back to the return point (home, or where the job started) and unload afterwards.dropJunktrue | falsedefault falseWhen the inventory fills, drop junk blocks before unloading.
Holes.
Dig a box downwards. The turtle sits on the near-left corner: width runs to its right, length ahead, depth below. It digs three layers per pass. Spots that cannot be dug (protected or unbreakable) are left alone and counted in the Console.
Returnstrue, or false, reason.
widthnumber (min 1)default 3Columns to the turtle's right, counting its own.lengthnumber (min 1)default 3Rows ahead of the turtle, counting its own.depthnumber (min 1)default 3Layers below the turtle.resumefalseStart from the top instead of continuing below the layers an earlier run dug.returnHometrue | falsedefault trueGo back to the return point (home, or where the job started) and unload afterwards.dropJunktrue | falsedefault falseWhen the inventory fills, drop junk blocks before unloading.
Remembered progress.
Turtles remember how far each strip mine, tunnel, ore mine and hole got, keyed by the start position and facing (and a hole's width and length). The record is kept on the turtle and, shared between all your turtles, on the server.
- Start a strip, ore or tunnel job from the same spot and it walks to the end of the old tunnel and mines
lengthmore. - A hole continues below the layers already dug, down to
depth. Ask for more depth to go further. - Pass
resume = falseto start over. Staircases are not remembered.
Forget the progress this turtle has recorded for all mines and holes. The shared copy on the server still counts, so to redo one particular site, start it with resume = false.