Raid JSON
Different aspects of the Pixelmon mod can be tweaked through different types of JSON files via a Datapack. This page covers the base_allies, spawn files and the raids.json file, which define the NPC allies, what Pokémon can spawn in Raid Dens in which biome and at what Star level(s) and the loot dropped respectively.
Loot Tables
The raids.json
file is where the loot table for raids are defined. As of 9.3.0, raid drops are now defined using Minecrafts loot table system and as such the file can be found in the path pixelmon\loot_table\raids.json
. Due to this change, a loot table generator for Vanilla can be used to generate the raid loot tables technically.
Below is a section of the raids.json
file which defines loot available for all type 1-star raids.
- The
rolls
part specifies how many rolls will be done of a pool. In each roll of a pool, the pool draws one entry from all its entries. Each roll of a pool is independent. - The
entries
part is where items to be added to the loot pool are defined. These are added with a name/value, a weight and a type. An entry can either be a single item or an entire seperate loot tables items which can be seen later in this page. - The
conditions
part is where the condition for the loot table is defined, such as the star level needed for the system to pick an item from that loot table which is seen further in theterms
section. Furthermore, the lastcondition
section is what defines the typing that is checked in order for this loot table to apply. The above example usesminecraft:all_of
which means all types of raids (Bug, Fairy, Psychic etc) will use this loot table.
Below is a section of the raids.json
which defines the loot table for 2-star level Grass Raids.
- Notice that one of the entries is an entire loot table for Grass types which is used in other parts of Pixelmon. This has been given a
value
ofpixelmon:intermediate/grass
in this file as opposed to the earlier example. This means one of the rolls can pull an item from that loot table. This grass loot table can be found inpixelmon\loot_table_intermediate
path. - This example also uses different conditions as it is specific to 2-star Grass types raids. The
terms
have been set to include Grass as apixelmon:secondary_type
Raid Spawns
Raid spawns, as of 9.3.0, are now defined per Pokémon species. These files can be access through the pixelmon\pixelmon\raid\spawn\
file path. By default, raid spawns are pulled from the standard Pokémon spawns however these can be edited in any way.
Below is the default spawning JSON for Bulbasaur.
{ "spawns": [ { "spec": "Bulbasaur", "loot_table": "pixelmon:raid_den/raids", "stars": { "type": "minecraft:uniform", "min_inclusive": 1, "max_inclusive": 2 }, "biomes": "#pixelmon:raid/spawn/0001_bulbasaur", "weight": 1.0 } ] }
- The
spec
field is where the Species is defined along with any additional Pokemon spec which can be added, such as forms and palettes. - The
loot_table
field is what Loot table is to be used for this Pokemon. By default, Bulbasaur will use the standard loot tables in theraids.json
file however this can be changed. - The
stars
field determines what star levels Bulbasaur can spawn at, with this example being a minimum of 1 star and maximum of 2 stars. - The
biomes
field determines where the Pokemon can spawn in raids. This can be edited to be any valid biome. Note that adding additional biomes or using biomes that may or may not be compatible with the pixelmon mod may result in the mod not working as intended. - The
weight
field determines the rarity of that Pokemon for spawning in raids. This weight is divided with the sum of all other weights in order to determine the spawn rarity.
Raid Allies
As of Version 9.3.0, the NPC allies that appear alongside the player in Max Raid Battles can be customised using the datapack file /data/pixelmon/pixelmon/raid/ally/base_allies.json
. A section of this file can be found below:
- The
biomes
list denotes which biomes the allies listed below can appear in. By leaving this empty, the NPCs can appear in all biomes by default. - The
star_range
property denotes the minimum and maximum star levels for which the allies can appear.
By adding additional files to the same directory as base_allies.json
via datapack, different conditions can be set for a particular group of NPC allies to appear. However, it is important for at least one ally to be available in each circumstance of biome and star level.
- The
allies
list contains details of each ally trainer which can appear, with the following subparts:- The
ai_mode
property determines the Battle AI Mode used by the trainer to choose their actions in battle. The available options areDEFAULT
,RANDOM
,AGGRESSIVE
,TACTICAL
andADVANCED
, and further details for each can be found here. - The
spec
property provides the details of the pokemon the trainer fights with. All Pokémon Spec arguments are accepted. - The
child
property determines if the trainer should use the smaller child-sized model, instead of the default player-sized model. - The
weight
value sets the probability of this trainer being selected compared to another ally. The actual chance for each ally slot isweight/(sum of all valid trainer weights)
. - The
name
value is the name the NPC ally uses in their battle text. - The
skin
property refers to the textures used by the NPC. This can be a texture within the pixelmon mod, another installed mod, or a custom resource pack.
- The
Creating a Data pack
Following the steps from the Datapack section, all you have to do is to:
- Create a
raids
folder - Copy over the original
raids.json
file. - Modify the data as you so desire.
Troubleshooting
- JSON Validation (Making sure commas are used properly)