Pixel Dream StudiosWiki

Values

Facts the world supplies at the moment of speaking, arriving as ordinary translation arguments so a translator can put them anywhere.

Values are listed under with, and arrive in the line as translation arguments in that order.

{
  "pages": [ { "translate": "mypack.golem.count" } ],
  "with": [ { "value": "villagers", "radius": 32.0, "age": "adult" } ]
}
{ "mypack.golem.count": "I keep %s of them. All of them, every night." }

That says "I keep seven of them." Because they are arguments rather than text spliced into the sentence, a translator can put the number wherever their own language wants it.

with sits on the dialogue, on a variant, or on a murmur line. A variant names its own rather than inheriting the file's.

The list

ValueFieldsGives
player_namenoneWhoever is being spoken to.
speaker_namenoneWhoever is talking, by the same name the panel is headed with.
times_spokentoday=false, + number styleHow often they have come to this speaker.
villagersradius=48, age=any, + number styleHow many are within the speaker's sight. radius is 1 to 128.
neighbourprofessions (list), radius=48The nearest of that trade, by name.

age on villagers is any, adult or child.

Numbers arrive as words

"…seven" is a sentence. "…7" is a debug readout. Any value that counts therefore spells itself out, up to ninety-nine, after which it falls back to figures.

Three fields adjust that, on any counting value:

FieldDefaultDoes
digitsfalseFigures instead of words. For a ledger, a price, a tally on a board.
capitalizefalseFor a number that begins a sentence.
off_by0Shifts the number reported. For a speaker who counts badly on purpose.
{ "value": "villagers", "radius": 32.0, "capitalize": true }

off_by is for characterisation: a speaker who is sure there are eleven of them, and just as sure there are nine two lines later, is a person.

neighbour

Names the nearest villager of a given trade.

{
  "pages": [ { "translate": "mypack.villager.neighbours", "fallback": "%s is about, if you need them." } ],
  "with": [
    {
      "value": "neighbour",
      "professions": [ "minecraft:farmer", "minecraft:librarian", "minecraft:cleric" ],
      "radius": 48.0
    }
  ]
}

Where nobody of that trade is within reach, the line still has to say something, so it falls back to a vague phrase rather than a blank.

Pair it with `village_has`

Put a village_has condition over the same trades on the line that uses neighbour, and a line that names somebody is only ever given where there is somebody to name.

Text this mod already ships

Two translation keys you can use in your own files, so the wording matches everywhere and is translated for you:

KeyEnglish
rpg_dialogue.choice.leave"I will trouble you no further."
rpg_dialogue.someone"one of the others"

rpg_dialogue.choice.leave is the farewell the panel supplies when a conversation offers no valid choices, so using it for your own way out keeps the two consistent.

Adding your own

A record, a MapCodec, and one call. See For mod developers.

On this page