Docs menu

Home and buildings

The bot's home is a small room dug into the ground, with its mine behind the back door. Around it grow the things that make the place livable: light, fields, and a bridge where it needs one.

Picking the place

For its first home the bot looks before it digs. A place is good when:

  • It isn't snow, ice, desert, ocean, swamp or badlands.
  • There are at least 24 logs of trees and 3 animals to hunt within 48 blocks.
  • The way down for the mine is dry: no water, lava or cave in it.

If the place is no good it says so and walks on, 48 blocks at a time, as long as it has time to work. Then it settles for the best place it saw.

Within the area it picks the exact spot: open ground with solid earth under it, where digging the room means building as little as possible, and where the planned mine would reach the most ore.

If you set a base for it, it builds there instead. Say set base location here.

The shelter

The shelter is under ground. The ground itself is its walls, roof and floor.

  • Stairs go 4 steps down from the surface.
  • The room is 3 wide, 3 high and 5 long.
  • Two wooden doors: one at the foot of the stairs and one at the far end, where the mine starts. With no door yet, it closes the entrance with blocks for the night and opens it in the morning.
  • Gaps in the walls or the roof are filled with dirt, stone or planks. Sand and gravel aren't trusted over its head.

It's built on the first day, right after the wooden tools. A shelter with a hole in it, gravel in the room or a missing door counts as broken, and is mended before each night.

Its own digging never goes through the shelter, the stairs or the ground over them.

Inside

The furniture has fixed places, with the middle of the room kept free from door to door:

  • Three double chests, two beside the front door and one further in.
  • A crafting table and a furnace, facing each other in the middle.
  • A bed along the wall.

The shelter always gets its own crafting table, even when one stands right outside.

The mine has furniture too: a crafting table on every floor, and a furnace and a chest on every second one.

Smooth stone

Later, in spare time, it swaps the weak blocks of the shelter's shell, such as dirt and planks, for smooth stone, a few dozen a visit. The home furnace makes the smooth stone in the background.

Storage

The bot puts things away each night once it's shut in, when it tidies up at home, and after a mine trip that filled most of its bag.

What stays on it: tools, weapons, armor, the shield, buckets, food, torches, and working amounts of logs, coal, sticks, cobblestone and dirt.

What goes in the chests: the bulk beyond those amounts, and half of everything else. Armor no better than what it wears is stored. Wooden tools it has outgrown are burned as fuel.

There's no sorting at home: it fills the nearest chest, then the next. Sorting chests by kind is the hauler's job.

A full bag in the middle of a job is emptied into a chest it knows. With none near, it crafts a chest, places it out of the way and tells you.

It remembers its chests. Every chest it opens is saved with what was in it. That's how it can answer:

You sayIt does
where are my diamonds?Names the chests that hold them, with their places and how long ago it looked.
what's in the chest?Opens the nearest chest and lists it.
put the cobblestone in the chestStores what you named. "Put your resources away" and "empty your inventory" work too.
take the iron from the chestTakes it out.
remember this chestAdds the chests near you to the ones it knows.
go home and tidy upWalks home and does its chores there.

For its own needs it takes only from chests it placed itself or that stand by its shelter.

Lighting

  • Inside: two torches on the walls, one near each end of the room.
  • Outside: torches on the ground in a grid around the top of the stairs, out to 14 blocks. In spare time the lit area grows to 28 and then 42 blocks.
  • It never lights your keep-out areas, its fields or the top of its shelter.

It keeps a stock of torches, made from spare coal. When coal is short it burns logs into charcoal.

The fields

The first field comes after the mine is started.

  • Crops: carrots, potatoes, beetroot or wheat, whichever it has. With nothing to sow it breaks grass for wheat seeds.
  • Size: 9 by 9, or 7 by 7 or 5 by 5 where the ground is rough, within about 20 blocks of home. It levels the plot first.
  • Water: the middle block is dug out and filled from its water bucket, once it has one. Before that it prefers a spot beside natural water.
  • Fence: wooden, all the way round, with an opening on the side facing home and torches on the posts.
  • Up to four fields. A new one is started when the others are fully sown and it has plenty of seeds.

It looks at the fields every few minutes while above ground. When enough crops are ripe it harvests them, sows again, mends the fence and the craters, and bakes the wheat into bread.

It keeps no animals; it hunts. A pen is something the builder can make for you.

The bridge

When the bot has had to swim through the same water near home more than once, or its field lies across water, it builds a bridge in its spare time.

  • Straight from bank to bank at the narrowest place nearby, 2 blocks wide.
  • Over water up to 48 blocks across.
  • Of cobblestone or other stone, or planks without any. It mines the cobblestone if it's short.
  • Lit with torches at both ends and along the deck.

Looking after the place

Coming home to tidy up, the bot:

  • puts things away and stores spare gear;
  • cooks raw meat and loads the furnace with ore to smelt;
  • makes torches;
  • fills holes in the ground beside the shelter, such as creeper craters;
  • makes a pickaxe or a sword if one is missing.

It also cuts down the trees right around its entrance, and closes the doors it opens behind it.

Keeping it out of your builds

keep out of here marks the area around where you stand, 16 blocks unless you say another size. Inside it the bot never digs, builds, harvests, lights, fells trees or makes fields. The area is remembered across restarts.

you can work here again lifts it.

On a server with protected land the bot notices when its blocks keep being put back, and stays away from that patch for a while.

The numbers on this page are the ones in the bot's code: building.ts, farm.ts and bridge.ts.