Pixel Dream StudiosWiki

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.

One file in a datapack, and a toolsmith will ask you for iron. Put it in a datapack in world/datapacks/, or in your mod's own data/ folder if you are writing one.

One file

What they want

data/mypack/errands/iron.json

{
  "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
}

Try it

Run /reload, then walk up to a toolsmith. About half the time they will be wearing a gold !, and their greeting will have "Is there anything you need?" in it.

That is a whole errand: the toolsmith wants between six and twelve iron, pays five emeralds, and thinks better of you for it. Nothing else is required, and there is no second file. The conversation it is asked in, the reminding when you come back short, the thanks when you hand it over and the mark over the head are all supplied.

What that file is already doing

It is only ever offered by a toolsmith. professions is asked of who they are, before anything else is weighed.

It asks for a different amount each time. The span is the whole point, and the reason is its own section.

It reaches every mod's iron, because #c:ingots/iron is a tag rather than an item. Written as "minecraft:iron_ingot" it would be an errand about vanilla's iron in particular.

It pays through RPG Dialogue's action registry, so anything a conversation can hand over, an errand can pay with: an item, a command, a mod's own currency.

It moves vanilla's gossip by eight. That is the same number that already sets your prices with that villager and already spreads to their neighbours on its own, so running errands is the way back from having helped yourself to a village.

The span is the point

A flat number is the same errand every time it is asked. The toolsmith wanted eight iron last week and wants eight iron today, and a player who has run it once has run it forever.

"count": 8
"count": { "min": 6, "max": 12 }

Written as a span they want seven this time and eleven the next, and it stops being an entry in a table and starts being somebody short of iron by however much they happen to be short. The figure is drawn once, when the promise is made, and written down, so however the day turns over afterwards they hold you to the number they said.

Who asks, and when

Two separate questions, and they are separate because one changes while the player is standing there and the other does not.

{
  "wanted": "#c:ingots/iron",
  "professions": [ "minecraft:toolsmith" ],
  "requires": [
    { "condition": "rpg_dialogue:in_weather", "sky": "thunder" }
  ]
}

professions asks who they are. requires asks about the moment, and takes the whole of RPG Dialogue's condition registry: the weather, the hour, the state of the village, whether they have stock, whatever a mod has taught it to ask about.

professions is only shorthand. Anything it can say, requires can say too, and requires can say a great deal more.

Saying it in your own words

Left alone, the villager asks plainly and names the goods. An errand with a reason behind it, which is most of the good ones, names a conversation of its own:

{
  "wanted": "#c:ingots/iron",
  "professions": [ "minecraft:toolsmith" ],
  "asking": "mypack:toolsmith_iron"
}

That is an ordinary dialogue file, written however you like, which ends in a choice carrying rpg_errands:take_errand. See Errands in conversation.

Next

On this page