In partnership with NodeCraft Logo NodeCraft

From Pixelmon Wiki

Different aspects of the Pixelmon mod can be tweaked through different types of external JSON files. This page covers the NPC files, which define many different settings for different types of NPCs, such as inventories for shopkeepers. NPC JSON files are located at <Minecraft directory>/pixelmon/npcs.

Examples of how to edit these files can be found on this page.

NPC JSON files that contain dialogue must have file names suffixed by an underscore and the language code that correspond to the language that the dialogue is written in. For example, the American English version of the Blacksmith JSON file is named blacksmith_en_us.json. Server-side information, such as the possible Pokémon an NPC Trainer can have, is always obtained from the American English version of the JSON file. Files in other languages are only used to obtain translation-specific data such as dialogue.

npcs.json

This JSON file contains data about NPC spawning rarity and which NPC JSON files to read. If a new NPC JSON file is created, the NPC must be added to this file in order for it to be registered by Pixelmon.

rarities

This array contains the rarities of each type of naturally spawning NPC (NPC Trainers, move tutors, move relearners, traders, and spawn shopkeepers).

  • type: The type of NPC to define the rarity of (trainer, tutor, relearner, trader, shopkeeper).
  • rarity: The relative spawning rarity of the NPC. Spawning rarities are relative between NPC types; if one type of NPC has a rarity of 200 and a second type has a rarity of 100, the first NPC type will spawn twice as often as the second type. An NPC with a rarity of 0 will not spawn naturally.

The default NPC Trainer entry is shown below.

   {
     "type": "trainer",
     "rarity": 200
   }

trainers

This array defines the spawn rarity and textures that an NPC Trainer will use.

  • name: Corresponds to the trainerType field in the data of the NPC Trainer JSON file.
  • rarity: The relative rarity of the NPC Trainer compared to other NPC Trainers. If this field is omitted, the NPC Trainer will not spawn naturally and can only be accessed using an NPC editor.
  • textures: An array of skin textures that the NPC Trainer can use, excluding the ".png" extension. Textures are located at assets/pixelmon/textures/steve in the Pixelmon jar file or a resource pack.

The Bug Catcher's entry is shown below.

     {
       "name": "BugCatcher",
       "rarity": 20,
       "textures": [ "bugcatcher1", "bugcatcher2", "bugcatcher3", "bugcatcher4" ]
     }

Other arrays

All other arrays in the npcs.json file define the NPC files to register for each type of NPC. The NPC files for each type are found at <Minecraft directory>/pixelmon/npcs/<NPC type>. The only field of each array object is a name field, which defines the name of the JSON file to register. This name field should not contain the language code or .json.

Array NPC type NPC folder
villagers Chatting NPC villagers
list NPC Trainer trainers
shopKeepers Shopkeeper shopKeepers
gymnpcs Gym NPC gyms

shopItems.json

This is a list of item IDs for items that are possible to buy from or sell to shopkeepers, along with the base buying price and the selling price of the item.

Existing buy and sell prices for items can be modified or removed. If an item has no sell price, the item cannot be sold to a shopkeeper. Items can also be removed from the list, although removing an item with a buy price also necessitates the removal of the item from all shopkeepers who offer the item in question. An item with a sell price will always be able to be sold to all types of shopkeepers; it is not possible to restrict an item to be sellable to only certain shopkeepers.

Additional items can be added to the list, including from vanilla Minecraft and from other mods. An item only needs to have a buy price if the item can be bought from a shopkeeper; otherwise, it is only necessary to define a sell price. A sample JSON entry for a typical item (a Poké Ball in this case) is shown below.

{
     "name": "pixelmon:item.Poke_Ball",
     "buy": 200,
     "sell": 100
}

Custom damage values or NBT tags may be appended to items using itemData and nbtData fields respectively. When using these extra fields, an id field is also required in order to refer to the custom item from the shopkeeper JSON files. The format for NBT tags is the same format that can be used in certain commands like /give, and is detailed on this page. Note that any " characters will need to be escaped with a \.

Below is a sample JSON entry that uses all of the fields that can be used in the JSON, creating spruce wood planks (damage value 1) that have the description, "Wooden planks".

{
    "id": "sprucePlanksLore",
    "name": "minecraft:planks",
    "itemData": 1,
    "nbtData": "{display:{Lore:[\"Wooden planks\"]}}",
    "buy": 5,
    "sell": 2
}

More examples of valid shop items can be found on this page.

Chatting NPCs

Chatting NPC JSON files are located at <Minecraft directory>/pixelmon/npcs/villagers.

  • skins: An array of filename fields defining all skin textures that the chatting NPC can use. Textures are located at assets/pixelmon/textures/steve in the Pixelmon jar file or a resource pack. The .png extension should be included in the file name.
  • names: An array of name fields defining the possible names that the chatting NPC can be named. The name is displayed when talking to the chatting NPC.
  • chat: An array of lines objects defining the lines of dialogue that the chatting NPC will say when talked to. This is split into multiple text fields so that the chatting NPC will say each batch of text one at a time (i.e., the player clicks to continue the dialogue).

A chat entry for the Artist chatting NPC is shown below.

       {
           "lines": [
               {
                   "text": "Ah, this town is so inspiring."
               },
               {
                   "text": "If only I had my easel with me; my mind is buzzing with artsy thoughts!"
               }
           ]
       }

NPC Trainers

NPC Trainer JSON files are located at <Minecraft directory>/pixelmon/npcs/trainers. If a new NPC Trainer JSON is added, it will initially only be available through the NPC editor.

  • data
    • trainerType: The ID of the NPC Trainer class, used by the "trainers" array in npcs.json to find this NPC Trainer's data.
    • minLevel: The minimum average level of the NPC Trainer's Pokémon.
    • maxLevel: The maximum average level of the NPC Trainer's Pokémon.
    • minPartyPokemon: The minimum number of Pokémon that the NPC Trainer can have.
    • maxPartyPokemon: The minimum number of Pokémon that the NPC Trainer can have.
    • winnings: The base amount of PokéDollars that the NPC Trainer will award to the player upon defeat. This base amount is multiplied by the average level of Pokémon in the NPC Trainer's party (rounded down) to produce a final PokéDollar amount.

The Blacksmith's data is shown below.

   "data": {
       "trainerType": "Blacksmith",
       "minLevel": 20,
       "maxLevel": 40,
       "minPartyPokemon": 1,
       "maxPartyPokemon": 6,
       "winnings": 32
   }
  • pokemon: A list of "name fields defining which Pokémon species the NPC Trainer can use.
  • names: A list of "name" fields defining what the NPC Trainer's names can be. This name is used to refer to the NPC Trainer during battle.
  • chat
    • opening: The NPC Trainer's dialogue at the start of the battle.
    • win: The NPC Trainer's dialogue when the NPC Trainer defeats a player.
    • lose: The NPC Trainer's dialogue when the NPC Trainer is defeated by a player.

The Blacksmith's chat data is shown below.

       {
           "opening": "My Pokémon are trained hard over the fires of endurance. They are invincible!",
           "win": "I did warn you! Nice try.",
           "lose": "Not as invincible as I thought.."
       }

Shopkeepers

Shopkeeper JSON files are located at <Minecraft directory>/pixelmon/npcs/shopKeepers.

  • data: This defines the spawning type of the shopkeepers; this can be either PokemartMain, PokemartSecond, or Spawn.
  • biomes: If the shopkeeper is a spawn shopkeeper, this list defines the biomes where the shopkeeper can spawn.
  • textures: All possible skins for the shopkeeper are defined in this list. Any existing textures from assets/pixelmon/textures/steve can be used here, and a resource pack may also place skins at this location for custom skins to be used.
  • names: This is a list of possible names for the shopkeeper. These names are displayed when talking to the shopkeeper.
  • chat: This is a list of possible greetings and parting phrases for the shopkeeper. The messages should be paired together in a single object.
  • items: This is a list of the items that can be sold by the shopkeeper.
    • The name field contains the item ID of the item to sell and is the only required field. If an item in shopItems.json has an id field defined, this ID is used to refer to that item here; otherwise, the item's name field (the item's internal Minecraft ID) is used.
    • The multi field is a multiplier that allows the particular shopkeeper type to offer an item for more or less than its base price as defined in the shopItems.json file.
    • The rarity field defines the chance (from 0 to 1) of the item appearing in the shopkeeper's stock each day. Leaving out this field causes the item to always appear in the shopkeeper's stock.
    • The variation field determines whether the item may randomly be priced at 10% above or below its usual price. By default, this is enabled.

A sample shopkeeper item is shown below. It causes the shopkeeper to have a 70% chance of selling Ultra Balls that are 10% above the normal price (as defined in shopItems.json) and do not vary in price.

{
     "name": "pixelmon:item.Ultra_Ball",
     "multi": 1.1,
     "rarity": 0.7,
     "variation": false
}

Another sample shopkeeper item is shown below. It causes the shopkeeper to always sell the custom spruce wood planks item defined above with its default base price, sometimes varying at 10% above or below this base price.

{
    "name": "sprucePlanksLore"
}

More examples of customizing shopkeepers can be found on this page.

Gym NPCs

Gym NPC JSON files are located at <Minecraft directory>/pixelmon/npcs/gyms. These files are used for editing flavor aspects of NPCs such as dialogue and skins. Data about the Pokémon used by Gym NPC Trainers is found in the structure JSON files.

  • npctype: Either trainer or chat for an NPC Trainer or a chatting NPC.
  • winnings: The base amount of PokéDollars that an NPC Trainer will award to the player upon defeat. This base amount is multiplied by the NPC Trainer's level to produce a final PokéDollar amount.
  • skins: An array of filename fields defining all skin textures that the NPC can use. Textures are located at assets/pixelmon/textures/steve in the Pixelmon jar file or a resource pack. The .png extension should be included in the file name.
  • names: This is a list of possible names for the NPC. The NPC's name is displayed when interacting with the NPC.
  • chat: Depending on the NPC's type, the NPC's dialogue is formatted the same as either an NPC Trainer or a chatting NPC.

© 2014 - 2020 Pixelmon Mod