Dialogs - MarkusBordihn/BOs-Easy-NPC GitHub Wiki
Step into the world of dialog systems, where creating engaging conversations for NPCs is easy. Learn about different dialog types designed for complex interactions and various scenarios.
Let's start with placeholders available for all dialog types. These placeholders let you create personalized and dynamic text in your dialogs.
| Placeholder | Description |
|---|---|
| @npc | Name of the NPC |
| @initiator | Name of the person starting the dialog |
For example, you can write Hello @initiator, my name is @npc! ๐
โจ Since Version 6.2.0
You can display scoreboard values directly in your dialog text using the @score() macro:
| Macro | Description | Example |
|---|---|---|
@score(scoreboard_name) |
Display player's scoreboard value | You have @score(coins) coins |
Usage Examples:
"Hello @initiator! You have @score(quest_points) quest points."
"Your current level is @score(player_level)."
"You need @score(items_collected) items to complete this quest."
"Your balance: @score(currency) gold coins."
The macro will automatically replace @score(scoreboard_name) with the actual value from the
player's scoreboard.
This is perfect for:
- Currency systems ๐ฐ
- Quest progress tracking ๐
- Player statistics ๐
- Achievement counters ๐
Note: If the scoreboard doesn't exist or the player has no value, it will display 0.
You can use various formatting options to make your dialog text stand out. Here are the available placeholders for text formatting:

Use these placeholders to add color to your dialog text. You only need the closing tag if you want to change the color back to the default.
| Placeholder | Formatting Code | Color Name | Example |
|---|---|---|---|
<black> |
ยง0 |
Black | <black>Text</black> |
<dark_blue> |
ยง1 |
Dark Blue | <dark_blue>Text</dark_blue> |
<dark_green> |
ยง2 |
Dark Green | <dark_green>Text</dark_green> |
<dark_aqua> |
ยง3 |
Dark Aqua | <dark_aqua>Text</dark_aqua> |
<dark_red> |
ยง4 |
Dark Red | <dark_red>Text</dark_red> |
<dark_purple> |
ยง5 |
Dark Purple | <dark_purple>Text</dark_purple> |
<gold> |
ยง6 |
Gold | <gold>Text</gold> |
<gray> |
ยง7 |
Gray | <gray>Text</gray> |
<dark_gray> |
ยง8 |
Dark Gray | <dark_gray>Text/dark_gray> |
<blue> |
ยง9 |
Blue | <blue>Text</blue> |
<green> |
ยงa |
Green | <green>Text</green> |
<aqua> |
ยงb |
Aqua | <aqua>Text</aqua> |
<red> |
ยงc |
Red | <red>Text</red> |
<light_purple> |
ยงd |
Light Purple | <light_purple>Text/light_purple> |
<yellow> |
ยงe |
Yellow | <yellow>Text</yellow> |
<white> |
ยงf |
White | <white>Text</white> |
Use these placeholders to add different styles to your dialog text.
| Placeholder | Formatting Code | Example |
|---|---|---|
<obfuscated> |
ยงk |
<obfuscated>Text</obfuscated> |
<bold> |
ยงl |
<bold>Text</bold> |
<strikethrough> |
ยงm |
<strikethrough>Text</strikethrough> |
<underline> |
ยงn |
<underline>Text</underline> |
<italic> |
ยงo |
<italic>Text</italic> |
<reset> |
ยงr |
<reset>Text</reset> |
You can also use these short codes for quick formatting.
| Short Code | Equivalent Formatting Code | Example |
|---|---|---|
<b> |
<bold> |
<b>Text</b> |
<i> |
<obfuscated> |
<i>Text</i> |
<u> |
<underline> |
<u>Text</u> |
<s> |
<strikethrough> |
<s>Text</s> |
The basic dialog displays simple text with a maximum of 255 characters.


The Yes/No dialog provides short text (up to 255 characters) and includes two buttons for actions based on the player's response.


In the action screen, you can define what happens when each button is clicked.
For the Yes button, you can give the player some stone and open the yes_answer dialog using the
command /give @initiator stone.


For the No button, you can give the player dirt and open the no_answer dialog using the command
/give @initiator dirt.


A preset for the Yes/No dialog example is available.
You can spawn a Humanoid (slim) NPC and import the preset easy_npc:give_dirt_or_stone_to_player.

The advanced dialog allows for more complex conversations with multiple entries and actions for each one. If you modify a basic or Yes/No dialog, it will automatically become an advanced dialog.


The dialog editor helps you create and modify dialog entries.

Options include:
- The name of the dialog entry
- The label/id of the dialog, used when opening the dialog via a button action
- Whether the dialog entry is the default dialog
- The dialog text
- The dialog buttons
Note: Only one dialog entry can be set as the default dialog.
The dialog text supports up to 6 text variations, which are chosen randomly to make the conversation more dynamic.

The button editor lets you create and modify dialog buttons.

You can define the button text and what actions should happen when the button is clicked.

You can trigger several actions in a specific order.

For example, with the Open Named Dialog action, you can specify which dialog should open when the
button is clicked.
Here, you could open the question_on_correct dialog for the right answer.

With the Command action, you could summon a firework_rocket to celebrate the correct answer.
If no actions are defined for a button, the dialog will close when the button is clicked.

You can also close the dialog using the Close Dialog action.

A preset is available for a quiz dialog example. You can spawn a Humanoid NPC and import the
preset easy_npc:professor_quiz.

A default dialog is selected automatically if there is an entry with the label default, start,
or main.
If none of these labels exist, the first dialog entry will be selected.
To keep it simple, itโs best to use one of these labels for the default dialog.
You can also use the "Default" button in the dialog editor to mark an entry as the default dialog.

Alternatively, you can use the following command to set the default dialog:
/easy_npc dialog set default <NPC-UUID> <Dialog Label>โจ Since Version 6.3.0
Dialogs now support a priority system to control which dialogs are shown first! This is especially useful when you have multiple dialogs with conditions.
| Priority | Value | Description |
|---|---|---|
| Critical | 100 | Highest priority - always shown first if conditions are met |
| High | 10 | Important dialogs like greetings, main quests |
| Normal | 5 | Regular dialogs, standard interactions |
| Low | 1 | Less important dialogs, farewells, idle chatter |
| Fallback | 0 | Default priority - shown when nothing else matches |
| Manual Only | -1 | Never automatically shown, must be opened explicitly |
The mod automatically assigns priorities based on dialog labels:
High Priority (10):
-
default,start,welcome,greeting,intro,introduction
Normal Priority (5):
-
main,question,help,info,information,talk,conversation
Low Priority (1):
-
bye,goodbye,farewell,exit,leave,thanks,thankyou,idle,random
Fallback (0):
- Any other label
Dialog priority works together with conditions:
- Highest priority dialogs with matching conditions are shown first
- If multiple dialogs have the same priority, the first one is used
- Manual Only dialogs are never shown automatically - they must be opened via commands or actions
Example Use Case:
Dialog 1: "greeting" (Priority: High) - Condition: first_visit == 1
Dialog 2: "welcome_back" (Priority: Normal) - Condition: visit_count > 1
Dialog 3: "main" (Priority: Normal) - No conditions
Dialog 4: "secret_quest" (Priority: Critical) - Condition: found_secret == 1
If the player has found_secret == 1, they'll see the "secret_quest" dialog first (Critical
priority).
Otherwise, if it's their first visit, they'll see "greeting" (High priority).
You can set custom priority values in the dialog editor for fine-tuned control over dialog ordering.
โจ Since Version 6.3.0
Add conditions to dialogs to show them only when specific requirements are met!
Show dialogs based on player scoreboard values:
Example:
- Show "wealthy_merchant" dialog only if
coins >= 1000 - Show "quest_complete" dialog only if
quest_progress == 100 - Show "beginner_tips" dialog only if
player_level < 5
Limit how many times a dialog can be shown:
Example:
- Tutorial dialog that shows only once
- Daily quest dialog that appears 7 times max
- Special event dialog with limited showings
Conditions work with the priority system - the highest priority dialog with matching conditions will be shown!
The dialog system includes several commands to manage and interact with dialogs.
You can open a dialog for the player using this command:
/easy_npc dialog open <NPC-UUID> <Player>To open a specific dialog entry, use this command:
/easy_npc dialog open <NPC-UUID> <Player> <DialogLabel>This command can also
be triggered by a command block, function, or other mods for scripted dialogs.
The dialog system supports translations for dialog texts, making it easy to internationalize your content. For more details on setting up translations, please refer to the Translations page.