Errand files
Every field an errand can hold, what it does without them, and what the log says when one is written wrong.
One errand per file, in data/<yourpack>/errands/<name>.json. Everything is optional except saying what you want.
{
"wanted": "#c:ingots/iron",
"count": { "min": 6, "max": 12 },
"professions": [ "minecraft:toolsmith" ],
"rewards": [ { "type": "rpg_dialogue:give_item", "item": "minecraft:emerald", "count": 5 } ],
"favour": 8
}The file path is the id. data/mypack/errands/village/stone.json is mypack:village/stone, folders and all, and that id is what a errands_run condition counts and what another pack claims to replace it.
One errand per file, the way one dialogue is one file. An errand naming an item nothing provides fails to read, and one file each means that failure costs exactly that errand rather than the twenty written beside it.
The fields
| Field | Default | Meaning |
|---|---|---|
task | rpg_errands:bring | Which of the three kinds. Left out it is bring, and nine in ten should be. |
count | 1 | How many, as a figure or a span. 1 to 256. See How many. |
called | the item's or tag's own name | What to call the haul, when neither serves. "A night's catch". |
professions | [] | Which trades ask this. Empty means the trade is not what decides it. |
entities | [] | Which kinds of creature ask this, for a mod whose people are not villagers. |
requires | [] | Everything else that has to hold. The whole condition registry. |
rewards | [] | What they get for it. The whole action registry. |
favour | 0 | 0 to 200. How well it is thought of afterwards, in vanilla's gossip. |
asking | a shared one | The conversation it is put to the player in. |
reminding | a shared one | What they say when the player comes back without it. |
thanking | a shared one | What they say when it is done. |
repeatable | true | Whether it may be run more than once. |
weight | 1 | 1 to 1000. How often it comes up against the others that fit. |
What is actually wanted, wanted for a fetch, quarry for a hunt, to and away for a delivery, is read flat out of the same file and belongs to the task.
Who asks
Three fields, and they answer two different questions.
professions and entities ask who they are, and either one alone is enough: an errand naming both is asked by that trade or by that creature. Naming neither means the trade is not what decides it, and anyone a pack points at the errand system may ask.
requires asks about the moment, and is weighed separately because it changes while the player is standing there and who somebody is does not.
{
"task": "rpg_errands:hunt",
"quarry": "#minecraft:raiders",
"count": { "min": 4, "max": 8 },
"requires": [
{ "condition": "rpg_dialogue:near_structure", "structures": "rpg_errands:ill_omened", "chunks": 6 },
{ "condition": "rpg_dialogue:in_village" }
]
}`professions` is shorthand and nothing more
Anything it can say, requires can say too, through profession. It is there because naming a trade is what most errands want and should cost one line.
Paying for it
rewards is a list of ordinary actions, run in order the moment it is settled. Anything a conversation can do, an errand can pay with.
"rewards": [
{ "type": "rpg_dialogue:give_item", "item": "minecraft:emerald", "count": 5 },
{ "type": "rpg_dialogue:give_item", "item": "minecraft:bread", "count": 3 },
{ "type": "rpg_dialogue:run_command", "command": "advancement grant @s only mypack:helped_out" }
]Because it is the whole registry, a mod that registers an action granting its own currency, skill points or reputation can pay out an errand without a line of this mod changing.
favour is separate and is not an action. It moves vanilla's own gossip with whoever is standing there, which is the number that already sets your prices, already spreads between villagers by itself and already fades. The shipped errands run from 4 for hauling logs to 14 for clearing a pillager outpost.
An errand that pays nothing is reported
Errand mypack:iron pays nothing at all in the log means no rewards and favour of zero. It is not fatal, since a pack may mean to pay in favour alone, but far more often it is a rewards block that failed to be written, and the symptom is an errand that feels broken rather than mean.
The three conversations
Every errand has three moments: being asked, being reminded, being thanked. Name a file for any of them and it is used; leave one out and a shared conversation is used instead, chosen by the kind of task.
| Task | Asking | Reminding | Thanking |
|---|---|---|---|
bring | rpg_errands:villager/errand/asking | .../reminding | .../thanking |
hunt | rpg_errands:villager/errand/hunt/asking | .../hunt/reminding | .../hunt/thanking |
deliver | rpg_errands:villager/errand/carry/asking | .../carry/reminding | .../carry/thanking |
Three sets rather than one, because the sentences are not interchangeable. "Bring me four of them" is nonsense said about wolves, and "so you are the one they sent" only makes sense said by somebody who was not there when it was agreed.
The shared ones name the goods and the number through values, so one written line serves every errand in the pack. Yours can do the same, or write it out in prose. See Writing your own.
repeatable and weight
repeatable: false for anything that would be strange to be asked for twice. It is counted for good: the tally of what a player has run outlives the promise itself, so a one-off stays run long after the village has forgotten the running of it.
weight decides how often an errand comes up against the others that fit the same speaker at the same moment. A weight of three comes up three times as often as a weight of one. It is not a percentage and does not have to add up to anything.
Adding an errand does not disturb the others
Every errand that fits is given a number drawn from who is asking, what day it is and which errand it is, and the lowest wins. So a pack adding a twelfth errand, or a player finishing a one-off, changes which errands are in the running without moving the numbers the others already drew.
What the log tells you
Three lines worth grepping for after writing errands.
| Line | Means |
|---|---|
Loaded 27 errand(s) | How many files parsed. Not how many are askable. |
27 of 27 errand(s) can be asked for in this world | Every item and entity tag every errand names resolved to something. Printed once the world is standing, and again after each reload. |
Could not read errand mypack:iron: ... | That file failed. |
Never infer success from the number loaded
A parse failure does not always drop the file: whatever parsed is kept, so an errand with one bad reward still loads and the count still reads as expected. Grep for Could not read.
The dormant report is the useful one. 26 of 27 names the odd one out, and the usual cause is a tag no installed mod fills, which is exactly what should happen for an errand written for a mod that is not here. See A tag nothing fills is never asked for.
Your first errand
One datapack file and a /reload. A villager asks you for something, pays you for it, and thinks better of you afterwards.
The three tasks
Fetch something, deal with something, carry word somewhere. Deliberately three, and how to name what is wanted so it reaches every mod that has one.
