External JSON files/Examples
This page contains examples of commonly made modifications to external JSON files.
Contents
- 1 Notes
- 2 Making NPCs not spawn naturally
- 3 Lowering an item's sell price
- 4 Making a Minecraft item sellable
- 5 Adding a boss Pokémon drop
- 6 Adding a normal Pokémon drop
- 7 Removing a normal Pokémon drop
- 8 Removing special drops
- 9 Adding a Minecraft item to special drops
- 10 Making a structure not spawn naturally
- 11 Adding a shopkeeper
- 12 Adding a buy price to a Pixelmon item
- 13 Adding a Minecraft item to a shopkeeper
- 14 Adding an item with data values to a shopkeeper
- 15 Adding an item with NBT data to a shopkeeper
Notes
- The following examples assume that external JSON files have already been enabled and generated. If not, the external JSON files page contains information on how to generate the files.
- You should understand the JSON format before editing these files. For example, you need to know that a JSON array has comma-separated values, with no comma after the last element. Failure to adhere to JSON formatting rules will result in the external JSON files failing to load.
- It is recommended to use a JSON validator (such as this one) to make sure that all of your edits comply with the JSON format.
- Note that comments (text between
/*
and*/
or text after//
are present in some external JSON files, although they are flagged as invalid by most validators. Before using a JSON validator, it is recommended that you remove any comments in the files that you edit. Removing these comments will not affect the data in the JSON file.
- Note that comments (text between
- Minecraft (client or server) should not be open when editing external JSON files.
- Back up external JSON files before editing, in case you mess up a file and want to revert it.
Making NPCs not spawn naturally
This examples makes all NPC types not spawn naturally; this will cause NPCs to only spawn inside structures or from an NPC editor.
- In
npcs/npcs.json
, find therarities
array - Change all
rarity
fields to 0. The modified rarities array is shown below."rarities": [ { "type": "trainer", "rarity": 0 }, { "type": "tutor", "rarity": 0 }, { "type": "relearner", "rarity": 0 }, { "type": "trader", "rarity": 0 }, { "type": "shopkeeper", "rarity": 0 } ],
Lowering an item's sell price
This example lowers the amount of PokéDollars obtained when selling a Rare Candy to a shopkeeper.
- In
npcs/shopItems.json
, find thepixelmon:rare_candy
entry. - Lower the
sell
field of the entry. The modified entry is shown below.{ "name": "pixelmon:rare_candy", "sell": 500 },
Making a Minecraft item sellable
This example allows diamonds to be sold to a shopkeeper.
- In
npcs/shopItems.json
, add the following entry to theitems
array.name
is the item ID of the item.{ "name": "minecraft:diamond", "sell": 1000 }
Adding a boss Pokémon drop
This example allows uncommon and rare boss Pokémon to drop diamonds.
- In
drops/bossdrops.json
, find themegadrops
array. - Add the following entry to the array.
"minecraft:diamond"
Adding a normal Pokémon drop
This example allows Bulbasaur to drop seeds.
- In
drops/pokedrops.json
, find the entry with thepokemon
field,Bulbasaur
. - Bulbasaur has a main drop, but no optional drops. Add the following entries to the object; these entries make Bulbasaur always drop 1-3 seeds.
"optdrop1data": "minecraft:wheat_seeds", "optdrop1min": 1, "optdrop1max": 3,
- Bulbasaur's new
pokedrops.json
entry will look like the following.{ "pokemon": "Bulbasaur", "maindropdata": "minecraft:vine", "maindropmin": 1, "maindropmax": 2, "optdrop1data": "minecraft:wheat_seeds", "optdrop1min": 1, "optdrop1max": 3, "raredropdata": "pixelmon:grass_gem", "raredropmin": 0, "raredropmax": 1 },
Removing a normal Pokémon drop
This example prevents Unown from dropping Life Orbs.
- In
drops/pokedrops.json
, find the entry with thepokemon
field,Unown
. - Remove the following three entries from the array.
"raredropdata": "pixelmon:life_orb", "raredropmin": 0, "raredropmax": 1
- Remove the comma at the end of the
optdrop1max
entry. - The end result is an Unown entry that looks like the following.
{ "pokemon": "Unown", "maindropdata": "minecraft:end_stone", "maindropmin": 1, "maindropmax": 2, "optdrop1data": "minecraft:ender_pearl", "optdrop1min": 0, "optdrop1max": 1 },
Removing special drops
This example removes mail from special drops.
- In
drops/pokechestdrops.json
, find thetier1
array. - Inside the array, find the entries for mail, shown below.
"pixelmon:pokemail_air", "pixelmon:pokemail_bloom", ... "pixelmon:pokemail_wave", "pixelmon:pokemail_wood",
- Delete all of the mail entries from the array.
Adding a Minecraft item to special drops
This example adds diamonds as tier 2 special drops.
- In
npcs/shopItems.json
, add the following entry to theitems
array.name
is the item ID of the item.{ "name": "minecraft:diamond" }
- In
drops/pokechestdrops.json
, find thetier2
array. - Add the following entry to the array.
"minecraft:diamond"
Making a structure not spawn naturally
This example makes haunted towers not spawn naturally.
- In
structures/structures.json
, find the entry labeledhauntedtower
. - Remove the
biomes
field from the entry, as shown below.{ "id": "hauntedtower", "filename": "hauntedtower.snapshot", "rarity": null, "depth": 1 }
Adding a shopkeeper
This example creates a new shopkeeper who sells only vitamins.
- In
npcs/npcs.json
, find theshopKeepers
array. - Add the following entry to the
shopKeepers
array.{ "name": "vitaminseller" }
- In the
npcs/shopKeepers
folder, find thepokemartmain1_en_us.json
file and duplicate it. Rename the duplicated file tovitaminseller_en_us.json
. - Inside the new
vitaminseller_en_us.json
file, find thetype
field inside thedata
array. ChangePokemartMain
toSpawn
.- This makes the shopkeeper only spawn when using an NPC editor. Although the shopkeeper is now a spawn shopkeeper, it will not spawn naturally because no biomes are defined for it.
- Find the
items
array and remove all items inside of it. - Add the six vitamin items to the items array. If you do not want prices fluctuating, add the
variation
field to each item and set it tofalse
. The modified items array is shown below."items": [ { "name": "pixelmon:hp_up", "variation": false }, { "name": "pixelmon:protein", "variation": false }, { "name": "pixelmon:iron", "variation": false }, { "name": "pixelmon:calcium", "variation": false }, { "name": "pixelmon:zinc", "variation": false }, { "name": "pixelmon:carbos", "variation": false } ]
- Start Minecraft and enter a world in Creative mode.
- Spawn in an NPC editor.
- Use the NPC editor to create a shopkeeper.
- Use the NPC editor on the shopkeeper to edit it.
- Cycle through the types of shopkeepers until you find the "vitaminseller" type.
- Select "Refresh Items" to reload the items that the shopkeeper is selling.
- Interact with the shopkeeper while not holding an item to verify that it is selling the six types of vitamins.
Adding a buy price to a Pixelmon item
This example adds a buy price to Rare Candy (which doesn't have one by default) and adds it to the stock of the "vitaminseller" shopkeeper created in the Adding a shopkeeper section.
- In
npcs/shopItems.json
, find thepixelmon:rare_candy
entry. - Add a
buy
field and a buy price to the entry. The new Rare Candy entry is shown below.{ "name": "pixelmon:rare_candy", "buy": 20000, "sell": 2400 },
- In
npcs/shopKeepers/vitaminseller_en_us.json
, add the following entry to the shopkeeper'sitems
array.{ "name": "pixelmon:rare_candy", "variation": false }
Adding a Minecraft item to a shopkeeper
This example adds a golden apple to the stock of the "vitaminseller" shopkeeper created in the Adding a shopkeeper section.
- In
npcs/shopItems.json
, add the following entry to theitems
array.name
is the item ID of the item.{ "name": "minecraft:golden_apple", "buy": 10000, "sell": 1000 }
- In
npcs/shopKeepers/vitaminseller_en_us.json
, add the following entry to the shopkeeper'sitems
array.{ "name": "minecraft:golden_apple", "variation": false }
Adding an item with data values to a shopkeeper
This example adds an enchanted golden apple (with data value of 1) to the stock of the "vitaminseller" shopkeeper created in the Adding a shopkeeper section.
Note: Data values are also known as "damage values" or "metadata".
- In
npcs/shopItems.json
, add the following entry to theitems
array. Theid
field can be named anything that does not conflict with an existing item ID. TheitemData
field defines the data value of the item.{ "id": "enchantedgoldenapple", "name": "minecraft:golden_apple", "itemData": 1, "buy": 50000, "sell": 5000 }
- In
npcs/shopKeepers/vitaminseller_en_us.json
, add the following entry to the shopkeeper'sitems
array. Note that the shopkeeper JSON'sname
field uses theid
of the item defined inshopItems.json
; using theid
is required when defining any data values.{ "name": "enchantedgoldenapple", "variation": false }
Adding an item with NBT data to a shopkeeper
This example adds an enchanted golden apple named "Notch apple" to the stock of the "vitaminseller" shopkeeper created in the Adding a shopkeeper section.
- In
npcs/shopItems.json
, add the following entry to theitems
array. ThenbtData
field contains NBT data for the item. Note that any quotation marks inside the NBT data string must be escaped (i.e., the quotation mark has a backslash (\
) preceding it).{ "id": "notchapple", "name": "minecraft:golden_apple", "itemData": 1, "nbtData": "{display:{Lore:[\"Notch apple\"]}}", "buy": 50000, "sell": 5000 }
- In
npcs/shopKeepers/vitaminseller_en_us.json
, add the following entry to the shopkeeper'sitems
array.{ "name": "notchapple", "variation": false }