How it works
Why about half a village wants something, why it changes at dawn, what the marks cost the server, and what is deliberately not here.
Useful to a pack author deciding how much to write, and to anybody wondering why the village behaves as it does.
An errand is worked out, not stored
What somebody wants today comes from their uuid, the day number and the errand's id, stirred together. Nothing is saved until a promise is actually made.
That is what buys all of this at once:
- It survives the chunk unloading under whoever was going to ask.
- Every player on a server is told the same thing by the same villager.
- It costs no saved bytes, in a world with two thousand villagers in it.
- It rotates at dawn on its own, with nothing scheduled and nothing to tick.
About half a village wants something on any given day. Fifty-five in a hundred, and the rest is the point. A village where everyone has a job for you is a quest hub with thatch on it: you stop talking to people and start clearing a list, and the one who genuinely needs something is indistinguishable from the eleven dispensing content.
The same answer three times
A villager is asked what they want three times over: once to decide whether to offer the choice at all, again when the player picks it, and again when the player agrees. Drawn at random the player would be shown one errand and handed another.
So the draw is steady, and so is the number. An errand written as a span wants twenty-six today and thirty-five tomorrow, and the figure is written into the ledger the moment the promise is made, so however the day turns over afterwards, they hold you to the number they said.
An offer is not a promise
An errand you were offered and did not take may well be gone tomorrow, because tomorrow is a different draw. One you agreed to is yours until you settle it or twelve days pass.
Every errand that fits is given a number drawn from who is asking, what day it is and which errand it is, weighted by weight, and the lowest wins. Drawing per errand rather than picking from a list is what keeps the answer steady when the list moves: adding a twelfth errand, or finishing a one-off, changes which errands are in the running without disturbing the numbers the others already drew.
The marks
Worked out on the server, because whether somebody has something to ask is a question about the player asking, and the client is told nothing it could not learn by walking up to them.
How often. Once a second, per player. What a villager wants turns over at dawn; the only thing that moves quickly is whether you are carrying enough yet.
How far. Villagers within 32 blocks. The client fades them out a little inside that, so one never pops into being in front of you.
What is sent. Only what changed. An unchanged village costs the looking and no packet.
Where it sits. Where a name tag would, bobbing gently. A murmur over the same head lifts clear of it rather than overlapping.
Four things take a villager out of being marked, and only the first two are stated in code:
- They are asleep. A mark over a bed is an invitation to stand there clicking.
- They are a child. A child asks for nothing.
- Another mod has claimed them. See
Errands.exempt. - Their conversation says nothing about errands. A nitwit, somebody the village has turned against, or anybody whose greeting your pack rewrote without an errand choice in it.
That last one is the important one. The question a mark has to answer is not "does the errand system have something for them" but "will the player see the option", and it is settled by asking RPG Dialogue which conversation would actually open for this player at this moment, conditions weighed, and then looking in that file for an errand choice.
Which is why a pack that rewrites a greeting is automatically right
Take the errand choices out of a profession's greeting and its villagers stop being marked, without telling this mod anything. Asking one particular mod which greeting it would choose would get the wrong answer the moment a pack outranked it, and the symptom is a mark over somebody whose conversation says nothing about errands.
The ledger
Promises are kept on the player, keyed by whoever asked.
- One per villager. Agreeing to one with somebody replaces nothing, because they can only have asked for one.
- Carried across death. Dying is not a way out of a promise.
- Lapses after twelve days. Long enough that an errand is not a timer, short enough that a promise means something.
- Settled is remembered for the rest of the day. Then it lapses back to nothing, and that villager has something else to say tomorrow.
- Pruned as it is written. Nobody ends up carrying a saved list of every villager they ever met.
Kept on the player rather than on the villager because a promise has to survive the chunk unloading under the person you made it to. Otherwise walking out of render distance is how you get out of an errand.
A promise whose errand a pack has since removed reads as nothing, so a player is never held to a promise the game can no longer describe.
Favour
favour moves vanilla's own gossip, and deliberately not a reputation of this mod's own. It is the number that already sets your prices, already decides whether the golems mind you, already spreads between villagers by itself and already fades.
Only whoever is standing there is told. They pass it on themselves, in their own time, which is both vanilla's behaviour and the truer one: a favour is between two people until one of them mentions it. For a delivery that means the village at the far end warms to you and the one that sent you does not, which is right. They have not heard yet.
Because it is the same number that a mod like RPG Villagers docks you for robbing the place, running errands is the way back from having helped yourself to a village, without either mod knowing the other exists.
What is deliberately not here
Nothing chimes. Not when the last wolf falls, not when the last iron goes into the pack. An errand is known two ways, by the mark and by asking, and every kind of errand is known those same two ways. A chime for one of the three would say that one of them is really a quest.
No timer, no counter, no quest log. The mark is the interface.
One kill answers one promise, even where it would answer two. A wolf is one wolf, and two villagers who both want the wolves seen to are both owed their own.
A hunt starts counting when you agree. Killing four wolves and then agreeing to deal with the wolves starts from none, which is the only reading that does not have players clearing the woods first and collecting afterwards.
A fetch is counted by what the thing is. No enchantment, no name, no durability is inspected, so a villager never turns away perfectly good iron for having a name on it.
