Jobs
A pet's job is decided by what it holds in its main hand, and which item makes which job is written in the tool tags such as entity_farmer_tools in Tags. For how it plays, see The Tool Decides the Job. Which chores each job does is written under pet_job/, with the job's id as the file name: farmer Farmer, fencer Fencer, archer Archer, musician Musician. Take the Farmer as an example, pet_job/farmer.json:
{
"work": [
"chiikawa:harvest",
"chiikawa:plant",
"chiikawa:deliver",
"chiikawa:weed",
"chiikawa:pick_mushroom"
],
"sight": {
"radius": 5,
"vertical_range": 1,
"forget_distance": 10.0,
"backoff_step_ticks": 30,
"empty_streak_limit": 3
}
}| Field | Meaning |
|---|---|
work | The job's chores, as errand ids. The order matters too: when two chores are otherwise equal, the one listed first is done first |
sight | How it looks for the blocks its chores deal with, see below. It is required when the list has a chore done to blocks, such as harvesting or pulling weeds; without it, the job does no chores at all. The Fencer's, Archer's and Musician's chores aren't done to blocks, so they don't have one |
The mod's other three files: the Fencer has chiikawa:melee and chiikawa:hunt_melee, the Archer has chiikawa:ranged and chiikawa:hunt_ranged, and the Musician has chiikawa:play_music.
Errands written in the code, such as following, shopping, giving presents and picking things up, and all pastimes, are considered by every pet and don't need to be listed here. The other way round, a chore that isn't in any job's list is done by no pet at all.
Looking for Chores
sight decides how a pet looks around for crops to harvest, ground to plant and weeds to pull:
| Field | Meaning | Default |
|---|---|---|
radius | How far it looks forwards, backwards and to each side, in blocks | 5 |
vertical_range | How far it looks up and down | 1 |
forget_distance | How far a block it remembers can be before it forgets it | 10 |
backoff_step_ticks | When it finds nothing several times in a row, each further time it waits this much longer before looking again | 30 |
empty_streak_limit | The most times counted, so the wait has a limit and a pet standing still still notices new chores | 3 |
Changing and Adding
To change a job file, replace it entirely. To have Farmers also do a chore you added, for example, write the mod's own five and yours into data/chiikawa/pet_job/farmer.json. Files can only be written for jobs that exist, and a file whose name matches no job is skipped. An errand in the list that doesn't exist gets a note in the log, and that entry isn't done while the rest carry on as usual. A file that can't be read only affects its own job, which is then left with just the things every pet does.
