helmet-battleBattle

📍 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 battle-type NPC

Battle-type NPCs are those that, when interacted with, display a dialogue interface with options to fight against them.

This type is the most common and versatile.

config/
└── CobbleBetterNPC/NPC/ash_npc_battle.json      
{
  "id": "cobblebetternpc:ash",
  "type": "battle",
  "names": ["Ash Ketchum"],
  "resourceIdentifier": "cobblemon:standard",
  "minPokemon": 3,
  "maxPokemon": 3,
  "interaction": [
    {
      "name": "dialogue one",
      "with": "1",
      "permission": "cobblebetternpc.ash.finish",
      "dialogue": "cobblebetternpc:ash_finish_battle"
    }
  ],
  "party": [
    "venusaur uncatchable=true level=5 hp_iv=10 attack_iv=10 defence_iv=10 special_attack_iv=10 special_defence_iv=10 speed_iv=10",
    "charizard uncatchable=true level=5 hp_iv=10 attack_iv=10 defence_iv=10 special_attack_iv=10 special_defence_iv=10 speed_iv=10",
    "blastoise uncatchable=true level=5 hp_iv=10 attack_iv=10 defence_iv=10 special_attack_iv=10 special_defence_iv=10 speed_iv=10"
  ]
}
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

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

"type": "battle",

resourceIdentifier

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

"cobblemon:standard"

"cobblemon:pikachu"

min and max

pokemons

It will tell us the maximum and minimum number that the NPC can use from the pool

"minPokemon": 3,

"maxPokemon": 3,

names

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

"names": ["Ash"],

interaction

Each object defines a visible option when interacting.

name, with, permission

and dialogue

party

NPC's Pokemon pool

name and any specs that are possible in cobblemon

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 dialogue that the player will see upon having the permission cobblebetternpc.ash.finish, which is a simple dialogue that occurs when the NPC defeats the NPC

  • DDialogue two will be the dialogue that has the buttons to start or reject the battle and also requires permission. cobblebetternpc.ash.intro

  • Dialogue three contains indications that it is required to be able to fight with him, that's why he doesn't have permission.

If you don't want any conditions and just want the player to be able to fight the NPC, delete all dialogues except for number 2 and delete their permission.

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)

✔️ Full Example Dialogue

✔️ Full Example NPC

Last updated