Docs menu

Companion jobs

A job is standing work the bot does for you until you take it away: guard you, farm a field, mine an ore, sort your chests, or build something.

Giving a job

Ask in chat, in your own words, standing where the work is:

  • be my guard
  • be my farmer here, put the wheat in the chest next to me
  • mine iron for me
  • sort my chests
  • build a hut here

The bot answers with what it took on, for example that it's your farmer for wheat at a place, and which chest the results go in.

  • The place of the job is where you stand when you ask. The farmer, the hauler and the builder need to see you, or they ask you to stand at the spot and say it again.
  • "The chest next to me" is the nearest chest or barrel within 6 blocks of you. Without one it uses the nearest chest it knows.
  • One job at a time. A new job replaces the old one.
  • The job is remembered across restarts.
You sayIt does
what's your job?Says which job it has, where, and where the results go.
you're off dutyEnds the job. "Off duty" and "stop your job" work too.

Both are answered in code, without the AI model.

How a job runs

A job is done in shifts: one bounded round of work, then a rest the job sets itself. A shift starts only when there is work, so a farmer with nothing ripe just waits.

  • Your orders come first. An order cuts in on a shift; the job goes on afterwards.
  • A job comes before its own life. Between shifts the bot goes on with its own life.
  • Reflexes pause a shift like any other work. See Survival and reflexes.
  • "stop" ends the shift. The job is kept, and it starts again by itself a minute later. To end the job, say it's off duty.
  • Day and night. The farmer, the hauler and the builder rest from sunset to dawn. The guard and the miner work at night too.

When a shift fails, the bot tells you the reason once and rests before trying again: 30 seconds, then 1, 2, 4, 8 and at most 10 minutes. After three shifts in a row with nothing done it pauses for ten minutes and says so.

Guard

It follows you 3 blocks behind and fights the hostile mobs that come for you: any within 10 blocks of you that it can see.

  • A fight ends when the mob is dead or has run 14 blocks from you. A mob it can't get to is left alone for a minute.
  • Ask it to stay and it guards the spot where you stood. Ask it to patrol and it walks around that spot.
  • It never attacks players, pets, horses, villagers, golems or neutral mobs such as endermen and piglins. Creepers are left to its own creeper reflex.
  • It works while it can see you. With you away, a following guard has nothing to do.

Farmer

It harvests the ripe crops within 12 blocks of the spot, replants each one from the seed it carries, and puts the produce in the chest.

  • Name a crop, like wheat, carrots, potatoes, beetroot, melons or pumpkins, and it takes only that one. With none named it takes everything ripe.
  • It keeps some seeds, carrots and potatoes on it for sowing again.
  • It doesn't till new ground or sow new fields for you; it works the field that's there. Its own fields are part of its home.

Miner

It makes trips into its own mine for what you named, 16 at a time, and stores what it brings back.

  • Iron is the default. It also mines coal, diamonds, gold, redstone, lapis and cobblestone.
  • It needs its shelter, where the mine starts, and at least a stone pickaxe. Without them it only takes what's in sight.
  • It keeps a little coal for itself and stores the rest.

Hauler

It sorts the chests and barrels within 10 blocks of the spot, so that each kind of thing has its own chest.

  • Eight kinds: tools and armor, food, ores, wood, farming, mob drops, stone and earth, and everything else.
  • A kind's chest is the one that already holds most of it.
  • It needs at least two chests it knows, which means chests it placed or has opened. Say remember this chest to show it one.
  • It moves only what it took out of chests, never its own things. If the right chest is full it tells you.

Builder

It builds one of three things at the spot, block by block:

You ask forIt builds
A hut5 by 5, cobblestone walls 3 high, a plank roof, a doorway on the north side.
A penA 7 by 7 ring of oak fence with a gate on the north side.
A wallCobblestone, 9 long from east to west and 3 high.
  • It gets the materials itself: from its chests, its mine and the trees. If it can't, it tells you what's missing and how many.
  • It clears ground and plants out of the way, and fills in water and lava.
  • It won't break your blocks. A chest or a built block in the way is named, with its place, and left alone. Natural blocks like dirt, stone, sand and leaves count as ground and are cleared, even if you placed them.
  • When the build is finished it says so, and the job ends by itself.

On servers with rules about bots

With SERVER_AUTOMATION=forbidden the bot takes no job: asked for one, it tells you the server doesn't allow it. Its own life is off as well, and it does only what you order. See Getting started.

Jobs are the newest part of the bot and have had the least play in real games. The numbers on this page are the ones in the code, in src/roles.