Favorite food
| Type | Trading mechanic |
|---|
A villager's favorite food is one extra trade that every employed villager gets after its first trade: it buys one serving of a randomly chosen food for an Obol, once. It is the only way to sell most of the pack's foods.
Mechanics
When the data pack loads, it starts a check that runs 3 seconds later and then every 30 seconds.[1][2] Each check looks at every loaded villager that:
- has a profession (any profession other than none), and
- has more than 0 villager experience, meaning the player has traded with it at least once, and
- has not been given a favorite food yet.
For each such villager, the pack picks a random whole number from 0 to 41 and runs the matching one of 42 food functions.[3] The number is passed to the function name through a macro, food_trades/food_$(num).[4] That function appends one offer to the end of the villager's trade list and tags the villager so it is never picked again:[5]
| Villager wants | Villager gives | Uses |
|---|---|---|
| 1 of the favorite food (4 for a chicken nugget) | 1 |
1 |
Every one of the 42 foods has the same 1 in 42 chance. The food in the trade carries the full item data of the pack's current version of that food, so it has to be a food made or found in the current version; older copies with a different format do not match.
Because the check needs the villager to have experience, the favorite food appears only after the first trade with a villager, and never on an unemployed villager or a nitwit. The favorite food is a villager trade only; the Wandering Trader does not get one.
An Amnestic clears the villager's favorite food flag. Since the villager keeps its experience, it is given a new random favorite food shortly after it takes a new profession.[6]
Foods
| # | Food | Amount |
|---|---|---|
| 0 | 1 | |
| 1 | 1 | |
| 2 | 4 | |
| 3 | 1 | |
| 4 | 1 | |
| 5 | 1 | |
| 6 | 1 | |
| 7 | 1 | |
| 8 | 1 | |
| 9 | 1 | |
| 10 | 1 | |
| 11 | 1 | |
| 12 | 1 | |
| 13 | 1 | |
| 14 | 1 | |
| 15 | 1 | |
| 16 | 1 | |
| 17 | 1 | |
| 18 | 1 | |
| 19 | 1 | |
| 20 | 1 | |
| 21 | 1 | |
| 22 | 1 | |
| 23 | 1 | |
| 24 | 1 | |
| 25 | 1 | |
| 26 | 1 | |
| 27 | 4 | |
| 28 | 1 | |
| 29 | 1 | |
| 30 | 1 | |
| 31 | 4 | |
| 32 | 1 | |
| 33 | 1 | |
| 34 | 4 | |
| 35 | 1 | |
| 36 | 1 | |
| 37 | 1 | |
| 38 | 1 | |
| 39 | 1 | |
| 40 | 1 | |
| 41 | 1 |
All 42 foods sell for 1 obol, including the curries and ramen, which take the most steps to cook.
Trivia
- The functions and tags use the internal names
favorite_food,trader_updateandfoodChecked. - The favorite food trade is added with a data command rather than through the pack's trade sets, which is why it does not appear on the profession pages' trade tables.
See also
References
| Mechanics | |
|---|---|
| Professions |
|
| Wandering Trader | |
| Traded goods | |
| Sacred texts | |
| Livestock | |
| Miscellaneous | |