Dialogs - MarkusBordihn/BOs-Easy-NPC GitHub Wiki

Dialogs 🗣️

Dialogs are the main conversation system in Easy NPC. They can be simple text popups, yes/no choices, or larger dialog trees with multiple entries, conditions, and button actions.

Placeholders 🧩

These placeholders work in dialog text:

Placeholder Description
@npc NPC name
@initiator Player name

Example:

Hello @initiator, my name is @npc.

Scoreboard Macro 🔢

Dialog text also supports the @score() macro:

Macro Description Example
@score(scoreboard_name) Shows the player's scoreboard value You have @score(coins) coins.

If the scoreboard or value does not exist, the shown value falls back to 0.

Text Formatting 📝

Dialog text supports the color and formatting placeholders shown below.

Dialog Text Formatting

Common examples:

  • <red>Warning</red>
  • <gold><bold>Quest Complete</bold></gold>
  • <gray>Come back later.</gray>

Dialog Types 💬

Basic Dialog

Basic dialog is the fastest setup for short text. It is best for greetings, one-step hints, and simple information screens.

Basic Dialog Setup screen Basic Dialog

Yes/No Dialog

Yes/No dialog adds two buttons with separate actions. It works well for confirmations, quests, shop prompts, or simple branching.

Yes/No Dialog Setup screen Yes/No Dialog

Each button can have its own action list.

Yes Dialog Button Setup Yes Dialog Button Actions No Dialog Button Setup No Dialog Button Actions

Advanced Dialog

Advanced dialog supports multiple entries, multiple text variations, dialog buttons, conditions, and priorities.

If you expand a simpler dialog with extra entries or advanced button logic, it effectively becomes an advanced dialog setup.

Advanced Dialog Setup screen Advanced Dialog

Dialog Editor 🛠️

The advanced dialog editor lets you manage:

  • entry label
  • default state
  • dialog text
  • button list
  • conditions
  • priority

Advanced Dialog Editor Advanced Dialog Text

Only one entry should normally act as the main automatic start point.

Button Editor 🔘

Dialog buttons can trigger multiple actions in order. This is where dialogs connect to commands, trading, and follow-up dialogs.

Advanced Dialog Button Editor Advanced Dialog Button Editor Setup Advanced Dialog Button Editor Open Dialog Advanced Dialog Button Editor Command

If no actions are defined, the button closes the dialog.

Advanced Dialog Close Button Advanced Dialog Close Dialog Action

Default Dialog 🏠

Easy NPC automatically prefers entries such as:

  • default
  • start
  • main

You can also mark an entry as default in the editor.

Advanced dialog default selection

Labels, Priority, and Conditions 🎯

Dialogs can be filtered and ordered with:

  • scoreboard conditions
  • execution-limit conditions
  • priority values

This is useful when the same NPC should react differently depending on player progress.

Examples:

  • first visit greeting
  • quest-ready dialog
  • fallback small talk
  • hidden dialog only opened by action or command

Current default priority groups in the code are:

  • Critical (100)
  • High (10)
  • Normal (5)
  • Low (1)
  • Fallback (0)
  • Manual Only (-1)

Labels such as default, start, or welcome are treated as high-priority defaults by the current code. Labels such as main, help, or question default to normal priority. Labels such as bye, idle, or thanks default to low priority.

Dialogs with priority Manual Only are never selected automatically and must be opened through an action or command.

Dialog Commands 📜

Open the current default dialog:

/easy_npc dialog open <NPC> <player>

Open a specific dialog by label:

/easy_npc dialog open <NPC> <player> <dialog_uuid_or_label>

Set a dialog priority:

/easy_npc dialog set priority <NPC> <dialog_uuid_or_label> <priority>

Dialog Textures and Resource Packs 🖼️

The dialog screen uses normal texture assets and can be changed with a standard resource pack. The current background textures are:

  • assets/easy_npc/textures/gui/dialog/scene_small.png
  • assets/easy_npc/textures/gui/dialog/scene_medium.png
  • assets/easy_npc/textures/gui/dialog/scene_large.png

The dialog navigation and close buttons also use normal textures:

  • assets/easy_npc/textures/gui/navigation_button.png
  • assets/easy_npc/textures/gui/close_button.png

To change the look, place files with the same paths inside your resource pack and let them override the originals. You do not need to modify the mod jar.

Dialog texture resource pack example

Config UI backgrounds can be overridden in the same way with:

  • assets/easy_npc_config_ui/textures/gui/config_screen/background.png
  • assets/easy_npc_config_ui/textures/gui/config_screen/background_small.png

Example Presets 🎁

  • easy_npc:give_dirt_or_stone_to_player
  • easy_npc:professor_quiz

Yes/No Dialog Preset Advanced Dialog Preset

⚠️ **GitHub.com Fallback** ⚠️