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. [Image here: A player mid-conversation with an NPC, numbered clickable choices in chat]

Assigning a dialog

Dialogs live in plugins/NMEntities/Dialogs/. Point an NPC at one:
Right-clicking that NPC now starts the conversation. Clear it with:
You can also set dialog: bob_talk directly in the NPC’s yaml. Dialogs reload with /nme reload.

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