message-dotsDialogue

📍 File Locations

All NPCs and dialogues are defined using JSON files, located in the following folders (these are created automatically when the server is started with the mod installed):

Required folder structure

config/
└── CobbleBetterNPC/
    ├── NPC/                 ← NPC JSON Files
    └── Dialogues/           ← JSON dialog files

These folders are automatically generated when the server starts. No restart is necessary: ​​use /cbn reload to apply the changes.

🧱 Basic structure of a dialogue-type NPC

Dialog-type NPCs are those that, when interacted with, display a dialog interface with options (as in the main Pokémon games).

This type is the most common and versatile.

Minimum required structure

config/
└── CobbleBetterNPC/NPC/nurse_joy_dialogue.json      
{
  "id": "cobblebetternpc:nurse_joy_001",
  "type": "dialogue",
  "resourceIdentifier": "cobblemon:standard",
  "names": ["Enfermera Joy"],
   "interaction": [
    {
      "name": "dialogue one",
      "with": "1",
      "permission": "",
      "dialogue": "cobblebetternpc:nurse_joy_dialogue"
    }
  ]
}
Field
Description
Example

id

Unique identifier for the NPC. Must be a valid identifier (namespace:path). Must never be repeated between NPCs. Used as a key to prevent merges.

"id": "cobblebetternpc:joy_001",

type

"dialogue" for this flow. Define which interaction will be used (DialogueInteraction).

"type": "dialogue",

resourceIdentifier

Define the base type; it can be a Pokemon or an NPC.

"cobblemon:standard"

"cobblemon:pikachu"

names

Names that rotate around the NPC (in the name tag).

"names": ["Nurse Joy"],

interaction

Each object defines a visible option when interacting.

name, with, permission

and dialogue

Below is an explanation of how each section of the interactions works.

chevron-rightnamehashtag
  • The name is simply a guide; it doesn't matter what you write in it.

chevron-rightwithhashtag
  • "with" the priority in which the dialogues will be shown.

You can use it however you want, but...

How is it recommended to use it?

We can do it hierarchically:

  • Dialogue one will be the first dialogue the player sees, so there always has to be at least one dialogue without permissions. This will be granted to us by the same NPC or another method.

  • Dialogue two will be the second menu the player sees, requiring user.1 permission. This same dialogue, or another method, will grant user.2 permission.

  • Dialogue three will be the last one the player sees, requiring user.2 permission. Since it has the "with 1" attribute, it will be the first one checked. However, because we didn't have user.2 permission before, it wasn't displayed until we obtained it.

chevron-rightpermissionhashtag
  • Permission node (requires LuckPerms). Only visible if the player has it.

chevron-rightdialoguehashtag
  • Dialogue ID (without .json), relative to Dialogues/.

💬 Dialog file (builder format)

Field
Description
Example

name

Name that appears in the NPC box (above the text).

"name": "Nurse Joy",

chevron-rightSTEP BY STEPhashtag

How are pages defined?

  • Definition of a page: [id] speaker: text

[id]: The id is just an identifier; you can use whichever one you want. speaker: npc/player

Interactive options (buttons)

  • Definition of a button: speaker -> button_text: action

circle-exclamation

Key rule

✔️ Full Example Dialogue

✔️ Full Example NPC

Last updated