Skip to main content
A dialog is a branching conversation: the NPC says something, the player picks a clickable reply, and the conversation moves on. Shopkeepers, quest givers, tutorial guides, lore characters. All of it in YAML, no code.

Assigning a dialog

Dialogs live in plugins/LodeEntities/Dialogs/. Point an NPC at one with its dialog field:
Right-clicking Bob now starts the conversation. You can also set it from the Entities menu editor (Dialog). Dialogs reload with /le reload. A dialog doesn’t have to belong to an NPC: an addon can start one for any player, from an item, a region or a quest step. See NPCs & Dialogs.

How a conversation is built

A dialog is a set of nodes. Each node does up to three things, in order:
  1. Says one or more lines.
  2. Optionally runs effect lines (give items, run commands, set variables).
  3. Either shows choices, or continues automatically to another node.
Here’s a complete one:
Read it top to bottom: at night Bob brushes you off, otherwise he greets you by name and offers up to three replies. The diamond option only appears if you’re actually carrying one. “Who are you?” loops back to the same choices, and the trade node hands over emeralds.

Node fields

The start: key at the top of the dialog lists candidate entry nodes. The first one whose conditions pass becomes the opening, which is how the night greeting above wins after dark.

Ending a conversation

A conversation ends when a node has no goto and no choices, when a chosen reply has no goto, or on goto: end. It also ends if the player walks more than 8 blocks away. One conversation runs per player at a time, and re-clicking the NPC restarts it. Old choice menus stop working once you’ve answered or restarted, so stale clicks in the chat scrollback are simply ignored.

Text and placeholders

say lines and choice text support legacy & colors and placeholders: <player.name> for the talking player, <var.x> for variables, and the rest of the usual set.

Remembering things

Set variables in a node’s effects, then check them in later conditions. That’s persistent quest state across a conversation and between conversations:

Where to go