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.
itemitem, componentsAn item's name. Pointing at it in the panel shows its tooltip.

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.

Values in the speaker's name

with fills the pages only. For speaker, use speaker_with. It works the same way. To put a title before the name the speaker already has:

{
  "speaker": { "translate": "mypack.guard.title" },
  "speaker_with": [ { "value": "speaker_name" } ],
  "pages": [ { "translate": "mypack.guard.greeting" } ]
}
{ "mypack.guard.title": "Guard %s" }

This shows "Guard Sydney". speaker_name is the entity's own name: its name tag, a name from a naming mod, or else its type. It never reads the file's speaker.

Without a lang file, "speaker": { "translate": "Guard %s" } works too: Minecraft shows the key itself when it has no translation.

Needs RPG Dialogue 1.0.10 or later.

item

Names an item. Pointing at the name in the panel shows the item's tooltip, as in chat.

{
  "pages": [ { "translate": "mypack.smith.bring", "fallback": "Bring me %s and %s is yours." } ],
  "with": [
    { "value": "item", "item": "minecraft:diamond" },
    {
      "value": "item",
      "item": "minecraft:iron_sword",
      "components": {
        "minecraft:item_name": "\"Kingsbane\"",
        "minecraft:enchantments": { "levels": { "minecraft:sharpness": 3 } }
      }
    }
  ]
}
FieldDefaultDoes
itemrequiredThe item. Not minecraft:air.
componentsnoneData components, in the format of components in a recipe's result.

The panel draws the name in the theme's link colour. It doesn't use the item's rarity colour: those are chat colours and can't be read on the panel's light stone.

Components are read when the line is said, not on /reload. Any that can't be read are left off, and the log says so once per /reload.

Murmurs show the name but no tooltip.

Needs RPG Dialogue 1.0.11 or later.

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