This guide explains how to create a Dialogue NPC , how the dialogue system works internally , and how NPC behaviours affect appearance and behavior in the world.
The goal of this document is not only to show what to write , but to explain why each field exists and what problem it solves .
All examples shown below are real, tested, and working .
📁 Required Folder Structure
Copy config/
└── CobbleBetterNPC/
├── NPC/
│ └── dialogues/
│ └── dialogue_001.json
└── Dialogues/
└── dialogues/
└── dialogue_001.json 📌 Why two different folders?
CobbleBetterNPC separates responsibilities:
Defines the NPC entity (appearance, behaviors, interactions)
Defines the conversation logic (text, pages, buttons, actions)
This separation allows:
Reusing the same dialogue for multiple NPCs
Editing dialogue text without touching the NPC entity
Keeping large projects organized and scalable
📌 Creating and reloading files
Generate example files with:
Apply changes without restart using:
🧍 Dialogue NPC File (Entity Definition)
📄 config/CobbleBetterNPC/NPC/dialogues/dialogue_001.json
This file defines the NPC as an entity in the world :
How it behaves physically
What dialogue opens when a player interacts
🧾 NPC Fields Explained (Line by Line)
Unique identifier for the NPC
Used internally to register and reload NPCs
Defines how the NPC reacts to interaction
"dialogue" means:
Right-click opens a dialogue UI
circle-exclamation
If this is not "dialogue", no dialogue will open .
🔹 resourceIdentifier
Defines the base entity model
Examples:
cobblemon:standard → humanoid NPC
cobblemon:pikachu → Pokémon NPC
Name displayed above the NPC
Used purely for presentation
🌍 World & Safety Settings
These fields control how the NPC behaves in the world .
Field
What it does
Why it matters
🔁 Interaction – Dialogue Selection Logic
This section defines which dialogue opens when the player interacts.
Fields explained
Priority (lower = checked first)
Required permission (empty = everyone)
📌 Rule: If multiple interactions exist, the system:
Sorts interactions by with (lowest first).
Checks permissions for each interaction in order.
Opens the first valid dialogue found.
Behaviours define how the NPC behaves physically , not what it says.
🧑 player_textured
Applies a player skin to the NPC
Requires the variable player_texture
Use this when:
Representing staff or story characters
👀 looks_at_players
NPC rotates its head to look at nearby players
Strongly recommended for dialogue NPCs
Provides essential base AI logic .
What it handles
💬 Dialogue File (Conversation Logic)
📄 config/CobbleBetterNPC/Dialogues/dialogues/dialogue_001.json
This file defines what is said , what choices appear , and what actions are executed .
Syntax:
Pages exist to:
Allow jumps using set_page
Support branching conversations
Syntax:
Rules:
Buttons belong to the last page above them
Clicking a button executes its action
Actions are reusable logic blocks .
Common actions:
Automatically closes the dialogue
Used when a page has no buttons
Ideal for final informational messages
Message shown only if the player presses ESC
Used as an exit flavor message