External JSON files
Certain aspects of Pixelmon, including special drops, NPCs, and structures, can be edited through JSON files. These files can be accessed by enabling the "useExternalJSONFiles" config setting and then starting Minecraft. The external JSON files will be created at the path, "<Minecraft directory>/pixelmon". JSON files can be edited with any plain text editor.
External JSON files should be edited carefully, and it is highly recommended to have knowledge of the JSON format before editing them. Incorrect editing of external JSON files can result in Minecraft crashing on startup. However, deleting an external JSON file will cause it to be regenerated with its default contents when Minecraft is started up again.
Contents
Special drops
The special drops JSON file, "drops.json", is located at "<Minecraft directory>/pixelmon/drops". It allows the special drop tables to be modified.
drops.json
drops.json contains three JSON arrays, "tier1", "tier2", and "tier3". Each array contains the item IDs of items that can be dropped in each special drop tier.
NPCs
NPC JSON files are located at "<Minecraft directory/pixelmon/npcs". It contains files used to define NPC data such as spawning details, dialogue, shopkeeper stock and sell prices, and NPC Trainer Pokémon.
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.
The default NPC Trainer entry is shown below.
{ "type": "trainer", "rarity": 200 }
trainers
This array defines the NPC editor name, spawn rarity, and textures that an NPC Trainer will use.
- "name": The name of the NPC Trainer file, without the language code or ".json".
- "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. In a resource pack, textures are located at "assets/pixelmon/textures/steve".
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 Trainer | gyms |
Structures
Structure JSON files are located at <Minecraft directory>/pixelmon/structures. This folder contains files that define Pixelmon structure aspects such as block composition, spawning details, and NPCs found inside the structures.
structures.json
This JSON file contains spawning data for all Pixelmon structures. It is split into three different arrays:
- "towns" contains structures that spawn in towns.
- "gyms" contains Gyms.
- "standalone" contains all other structures that are not Gyms and do not spawn in towns.
Each array consists of structures of that array's type. The three different types of structures each have different fields that can be specified.
towns
- "id": The ID of the structure when spawned via the /struc command
- "filename": The block snapshot file that defines the structure's block data, relative to "pixelmon/structures/towns".
- "weighting": Used to determine the relative rarity of spawning the structure
- "depth": How far into the ground the structure will spawn at.
- "maxnum": The maximum amount of structures of this type that can spawn in a town.
- "npcs": Data about NPCs that spawn in the structure.
- "type": The type of NPC to spawn.
- "data": Additional arguments modifying the NPC, such as "Main" or "Secondary" for shopkeepers.
- "x": The x component of the coordinate where the NPC spawns, relative to the origin of the structure.
- "y": The y component of the coordinate where the NPC spawns, relative to the origin of the structure.
- "z": The z component of the coordinate where the NPC spawns, relative to the origin of the structure.
The town Pokémon Center JSON data is shown below as an example.
{ "id": "towncenter1", "filename": "pokecenter1.snapshot", "weighting": 20, "depth": 2, "maxnum": 1, "npcs": [ { "type": "NurseJoy", "x": 9, "y": 3, "z": 7 } ] }
gyms
- "id": The ID of the structure when spawned via the /struc command
- "filename": The block snapshot file that defines the Gym's block data, relative to "pixelmon/structures/gyms".
- "npcdata": The JSON file that defines the Gym's NPC spawning data, relative to "pixelmon/structures/gyms".
- "depth": How far into the ground the Gym will spawn at.
The Grass Gym JSON data is shown below as an example.
{ "id": "grassgym", "filename": "grassgym.snapshot", "npcdata": "grassgym.json", "depth": 8 }
standalone
- "id": The ID of the structure when spawned via the /struc command
- "filename": The block snapshot file that defines the Gym's block data, relative to "pixelmon/structures/standalone".
- "biomes": The names of biomes that the structure can spawn in.
- "rarity": Used to determine the relative rarity of spawning the structure.
- "depth": How far into the ground the Gym will spawn at.
The frozen shrine JSON data is shown below as an example.
{ "id": "iceshrine", "filename": "shrine1.snapshot", "biomes": [ "Ice Plains Spikes", "Ice Plains", "Ice Mountains", "Cold Taiga M" ], "rarity": 20, "depth": 0 }
Block snapshots
Block snapshot (.snapshot files) are used to define the blocks that make up a structure. They can be created and modified using the /psnapshot command. Note: Command syntax is displayed in the standard Minecraft command format. An explanation of this format can be found here.
- /psnapshot load <file name>: Loads a set of blocks previously saved to a file by /snapshot save.
- /psnapshot set: Sets a corner of the area to save at the player's location. If there are already two corners set when this command is used, the corner that was set first will be overwritten by the new corner.
- /psnapshot save: Saves the blocks in the area defined by the two previously set corners. Two corners must already be set in order for this command to work. If a set of blocks was already previously saved, it will be overwritten by the newly saved set of blocks.
- /psnapshot save <file name>: Saves the blocks in the area like in /snapshot save. Also saves the blocks to a file (with the given name) in a "snapshots" folder inside the Minecraft folder. This file can be read back into Minecraft with the "load" argument.
- /psnapshot place: Copies the previously saved blocks and places them where the player is located.
- /psnapshot convert <file name>: Converts a snapshot created in Minecraft 1.8.9 and below into a snapshot compatible with Minecraft 1.10.2. This creates a new snapshot file with "-converted" appended to the original file name.
Gym NPC data
NPCs inside Gyms are defined in a JSON file separate from the structures.json file. This JSON file is split into two arrays:
- "npcs" for data about NPCs themselves.
- "pokemon" for data about possible Pokémon that NPC Trainers within the Gym can use.
npcs
- "name": The ID of the NPC. This leads to the corresponding file at "pixelmon/npcs/gyms", which defines most of the data about the NPC such as dialogue and skins.
- "type": The type of NPC to spawn.
- "rotation": The rotation (yaw) of the NPC relative to the Gym's rotation.
- "x": The x component of the coordinate where the NPC spawns, relative to the origin of the Gym structure.
- "y": The y component of the coordinate where the NPC spawns, relative to the origin of the Gym structure.
- "z": The z component of the coordinate where the NPC spawns, relative to the origin of the Gym structure.
An entry for one of the Grass Gym's NPC Trainers is shown below.
{ "name": "grassgymbase", "type": "trainer", "tier": 3, "rotation": 90, "x": 13, "y": 3, "z": 25 }
pokemon
- "name": The Pokémon's species.
- "minLevel": The minimum level that the NPC Trainer can be in order to potentially use this Pokémon.
- "maxLevel": The maximum level that the NPC Trainer can be in order to potentially use this Pokémon.
- "sets": Defines data about the Pokémon moves, Abilities, held items, Natures, and EVs. It is possible to have multiple sets for a Pokémon.
- "move<number>": A move that the Pokémon can have in a certain moveslot. It is possible to define multiple moves for a moveslot; one will be randomly chosen when the Pokémon is used. Omitting a moveslot causes the Pokémon to have no move in the omitted slot.
- "helditem": Defines possible held items that the Pokémon can hold. Omitting this field causes the Pokémon to not hold an item.
- "nature": Defines possible Natures that the Pokémon can have. Omitting this field causes the Pokémon to randomly have any of the 24 Natures.
- "ev<stat>": Defines the number of EVs that the Pokémon will have for a certain stat.
- "doubleOnly": If set to true, the Pokémon will only appear if the NPC Trainer conducts double battles.
- "lead": If set to true, the NPC Trainer will attempt to send out this Pokémon first during battle.
An entry for one of the Pokémon inside the Grass Gym is shown below.
{ "name": "Servine", "minLevel": 17, "maxLevel": 35, "sets": [ { "move1": [ "Giga Drain" ], "move2": [ "Reflect" ], "move3": [ "Light Screen" ], "move4": [ "Glare", "Leech Seed", "Synthesis", "Toxic" ], "heldItem": [ "pixelmon:light_clay" ], "nature": [ "Bold" ], "evHP": 252, "evDef": 252, "evSpDef": 4 }, { "minLevel": 31, // Only use the set at higher levels. "move1": [ "Leaf Blade" ], "move2": [ "Coil", "Swords Dance" ], "move3": [ "Aqua Tail", "Iron Tail", "Return" ], "move4": [ "Aqua Tail", "Iron Tail", "Return" ], "ability": [ "Overgrow" ], "heldItem": [ "pixelmon:muscle_band", "pixelmon:miracle_seed" ], "nature": [ "Adamant", "Jolly" ], "evAtk": 252, "evSpDef": 4, "evSpeed": 252 } ] }