Join our discord
In partnership with NodeCraft Logo NodeCraft


You are not logged in! Create an account or login to contribute! Log in here!

Difference between revisions of "Samosa's Playground"

From Pixelmon Wiki
m (added images)
m
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Certain aspects of Pixelmon, such  as species, [[NPCs]], [[drops]] and [[structures]] can be edited through [https://www.json.org/ JSON] files.
+
<seo title="Raid JSONs" metakeywords="Pixelmon Reforged JSONs Datapacks spawns drops moves rules NPCs stats structures shops shopkeepers" metadescription="A guide explaining how to configure Pixelmon's raid file."/>
These files can be accessed by using a program such as [https://www.win-rar.com/start.html?&L=0 Winrar] or [https://www.7-zip.org/ 7-Zip] to open the Pixelmon mod JAR file, and must be applied using a [https://minecraft.fandom.com/wiki/Data_pack Datapack]. JSON files can be edited with any plain text editor however it is recommended to use a program dedicated to editing code files, such as [https://code.visualstudio.com/ Virtual Studio Code] or [https://notepad-plus-plus.org/downloads/ Notepad++].
+
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 Den|Raid Dens]] in which biome and at what Star level(s) and the loot dropped respectively.
  
External JSON files should be edited carefully, as bad edits can potentially result in unexpected behavior from Pixelmon. Certain tools (such as [https://jsonlint.com/ JSONLint]) can be used to verify that files are formatted correctly.
+
==Loot Tables==
After editing JSON files in an existing datapack, they will need to be reloaded in order for the changes to take effect. It is advised to restart your client or server to ensure all files are applied correctly.
 
  
The following types of files can currently be edited via a datapack:
+
The <code>raids.json</code> file is where the loot table for raids are defined. As of 9.3.0, raid drops are now defined using [https://minecraft.wiki/w/Loot_table Minecrafts loot table system] and as such the file can be found in the path <code>pixelmon\loot_table\raids.json</code>. Due to this change, a [https://misode.github.io/loot-table/ loot table generator for Vanilla] can be used to generate the raid loot tables technically.
{|class="wikitable"
 
|-
 
|style="text-align:center"|'''File type'''
 
|style="text-align:center"|'''Description'''
 
|-
 
|style="text-align:center"|[[Advancements JSONs|Advancements]]
 
|Governs [[advancements]] obtained from doing certain actions. These use the [https://minecraft.fandom.com/wiki/Advancement/JSON_format Minecraft advancement JSON format].
 
|-
 
|style="text-align:center"|[[Boss Tiers JSONs|Boss Tiers]]
 
|Governs [[Boss]] Pokemon tiers, including their drops, mega specifications and colour.
 
|-
 
|style="text-align:center"|[[Config JSONs|Config]]
 
|Governs several different configuration files, including [[Starter]] specs, [[Shopkeeper]] items, the [[Better_Spawner/Config|Better Spawner config]], [[Traders]] and NPC [[Trainer]] textures.
 
|-
 
|style="text-align:center"|[[Daycare JSONs|Daycare]]
 
|Governs [[Daycare]] settings, including the item costs and hour costs for each type.
 
|-
 
|style="text-align:center"|[[Dimension JSONs|Dimension]]
 
|Governs settings for [[Ultra Space]] and [[Drowned World]], such as the biomes that are generated and structures.
 
|-
 
|style="text-align:center"|[[Drop JSONs|Drops]]
 
|Governs settings for [[Drops]], including Pokemon drops, [[Pokeloot]], [[Raids]] and imprint amounts for [[TRs]] and  [[TMs]].
 
|-
 
|style="text-align:center"|[[Loot Table JSONs|Loot Table]]
 
|Governs settings for Loot tables used in Pixelmon Structures and [[Pokestop]] loot along with block drops.
 
|-
 
|style="text-align:center"|[[Move JSONs|Moves]]
 
|Governs configuration files for each [[Move]] and is where custom-created Moves are located.
 
|-
 
|style="text-align:center"|[[NPC JSONs|NPCs]]
 
|Governs many [[NPCs|Pixelmon NPC]]-related settings, such as [[Shopkeeper]] NPCs, NPC [[Trainer]] sets and [[Chatting NPCs]].
 
|-
 
|style="text-align:center"|[[Pokeball JSONs|Pokeballs]]
 
|Governs configuration files for [[Pokeballs]] such as controlling the assets used, the capture method and logic used. This is where custom Pokeballs should be located.
 
|-
 
|style="text-align:center"|[[Quests/Creation|Quests]]
 
|Governs default and custom [[quests]].
 
|-
 
|style="text-align:center"|[[Raid JSON|Raids]]
 
|Governs which Pokémon can spawn in [[Raid Den|Raid Dens]] in which biome and at what Star level(s).
 
|-
 
|style="text-align:center"|[[Recipe JSONs|Recipes]]
 
|Governs configuration files for all [[Recipes]] in Pixelmon, including recipes used in the [[Infuser]] and Vanilla machines.
 
|-
 
|style="text-align:center"|[[Marks/custom|Ribbons]]
 
|Governs configuration files for the various [[Marks]] and [[Ribbons]] in Pixelmon. This is where custom Marks and Ribbons will be located
 
|-
 
|style="text-align:center"|[[Rule JSONs|Rules]]
 
|Governs rulesets and tiers for competitive battling.
 
|-
 
|style="text-align:center"|[[Spawn Replacement JSONs|Spawn Replacement]]
 
|Governs settings for Spawn Replacement logic used by Pixelmon that replaces Vanilla Mobs with Pokemon. This is used to re-enable specific vanilla mobs or change the replacement logic.
 
|-
 
|style="text-align:center"|[[Spawning JSONs|Spawning]]
 
|Governs what Pokémon spawn where, when and how. Includes [[fishing]], [[bosses]] and [[Spawner Cave Rock|Cave Rock]]/[[Pixelmon Grass|Grass]] spawns. This also includes [[NPC]] spawning files.
 
|-
 
|style="text-align:center"|[[Species JSONs|Species]]
 
|Governs Pokémon species files which include every part of information about a Pokemon. Their moves, stats, egg group, mount settings, palettes and forms. This is where custom species should be located and where custom forms can be added into.
 
|-
 
|style="text-align:center"|[[Structure JSONs|Structures]]
 
|Governs what [[structures]] can spawn, and where. This is where structure files are located to be edited. Only affects new chunks.
 
|-
 
|style="text-align:center"|[[Worldgen JSONs|World Gen]]
 
|Governs settings for world generation settings, such as how a structure should be generated.
 
|}
 
  
'''Please note:''' When Pixelmon is updated, internal copies of the above files may change but external will not. If you are using a datapack, keep a close eye on the changelogs and refresh or update files where necessary. Outdated files may cause issues, or contain bugs that have since been fixed.
+
Below is a section of the <code>raids.json</code> file which defines loot available for all type 1-star raids.
  
== Creating a Data pack ==
+
<spoiler text="Show">
 +
<div onload="prettyPrint()">
 +
<pre class="prettyprint">
 +
    {
 +
      "rolls": {
 +
        "min": 1.0,
 +
        "max": 5.0,
 +
        "type": "minecraft:uniform"
 +
      },
 +
      "bonus_rolls": 0.0,
 +
      "name": "raid",
 +
      "entries": [
 +
        {
 +
          "name": "pixelmon:rare_candy",
 +
          "weight": 25,
 +
          "type": "minecraft:item"
 +
        },
 +
        {
 +
          "name": "pixelmon:ruby",
 +
          "weight": 50,
 +
          "type": "minecraft:item"
 +
        },
 +
        {
 +
          "name": "pixelmon:sapphire",
 +
          "weight": 50,
 +
          "type": "minecraft:item"
 +
        },
 +
        {
 +
          "name": "minecraft:amethyst_shard",
 +
          "weight": 50,
 +
          "type": "minecraft:item"
 +
        },
 +
        {
 +
          "name": "pixelmon:crystal",
 +
          "weight": 50,
 +
          "type": "minecraft:item"
 +
        },
 +
        {
 +
          "name": "pixelmon:dynamax_candy",
 +
          "weight": 100,
 +
          "type": "minecraft:item"
 +
        },
 +
        {
 +
          "name": "pixelmon:xs_exp_candy",
 +
          "weight": 100,
 +
          "type": "minecraft:item"
 +
        },
 +
        {
 +
          "name": "pixelmon:s_exp_candy",
 +
          "weight": 100,
 +
          "type": "minecraft:item"
 +
        }
 +
      ],
 +
      "conditions": [
 +
        {
 +
          "terms": [
 +
            {
 +
              "stars": 1,
 +
              "condition": "pixelmon:star_level"
 +
            }
 +
          ],
 +
          "condition": "minecraft:all_of"
 +
        }
 +
      ]
 +
    },
 +
</pre>
 +
</div>
 +
</spoiler>
  
'''This section will provide a detailed guide on how to create a basic Datapack for Pixelmon including how to extract files from Pixelmon, add them to your Datapack and edit them. This example will turn Bulbasaur into a Fire-Poison Type. For a more technical guide and further explanation of Datapack functions, see [https://minecraft.fandom.com/wiki/Tutorials/Creating_a_data_pack here]'''
+
* The <code>rolls</code> 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.  
[[File:DatapackCreation1.png|thumb|250px|1. You can easily go to the Datapacks folder by going in-game, hitting Edit on a world and opening the World folder.]]
 
[[File:DatapackCreation3.png|thumb|300px|3. Windows may show a warning when creating a mcmeta file if you made a Text file. This is fine and is helpful to see if you changed the file type correctly.]]
 
[[File:DatapackCreation10.png|thumb|250px|10. The Pixelmon Mod JAR file will need to be opened with a program such as Winrar/7Zip. The icon for the JAR may differ.]]
 
[[File:DatapackCreation11.png|thumb|300px|11. Red signifies the matching file paths. Bottom is your datapack. Blue signifies where the Bulbasaur file will go.]]
 
[[File:DatapackCreation12.png|thumb|250px|12. What your edited file code should look like.]]
 
  
# Find a suitable location to create the Datapack. It's advised to create a datapack in an easily accessible folder, such as your Documents, Downloads or Desktop. You can also go to your World folder -> Datapacks folder and create it there. This tutorial will create a Datapack in an existing world. You can get to the Datapacks folder from in-game too.
+
* The <code>entries</code> 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.
# Create a folder in the Datapacks folder. This is what the Datapack will be called. Ensure it starts with lowercase letters and can only contain lowercase letters, numbers, underscores, hyphens, and periods. For example, <code>My_Example_Datapack</code> is suitable.
 
# In your Datapack folder, right click and create a Text Document called <code>pack.mcmeta</code>. The entire file name should be replaced with this, including the "txt" part. IMPORTANT: The file extension must be an mcmeta file, not a JSON or Text type. It's advised you enable "hidden file extensions" to verify this.
 
# Open the pack.mcmeta file with a text editor. Notepad is suitable. Paste the following code into the file. Once pasted, save the file and close:
 
#: <pre>{&#10;  "pack": {&#10;    "pack_format": 6,&#10;    "description": "My test datapack"&#10;  }&#10;}</pre>
 
# Create a new folder called <code>data</code>. Go into this folder. Create a folder called <code>pixelmon</code>. Your file path should be <code>My_Test_Datapack\data\pixelmon\</code> excluding your world.
 
#* ''Note: You should now have a working empty Datapack. To verify this, go into your world and type <code>/datapack list</code>. If you wish to see how to create an example Datapack, continue reading.''
 
# Next you will need to find the file you wish to edit. For this example, we will be turning Bulbasaur into a Fire-Poison Type.
 
# Go the Pixelmon mod file. If you are in-game, you can get here quickly by hitting escape and go to Options -> Resource Packs -> Open Pack folder. Then go back one folder and into the mods folder. Another method is through your launcher. See [https://pixelmonmod.com/wiki/How_to_find_your_config_files here]. Instead of going to <code>config</code>, go to <code>mods</code>.
 
# Right click the Pixelmon mod file (typically named <code>Pixelmon-(MC version)-(MOD VERSION)-universal)</code>. Open it with your preferred archiver tool. Most commonly used ones are [https://www.win-rar.com/start.html?&L=0 Winrar] or [https://www.7-zip.org/ 7-Zip].
 
# Go into the <code>data\pixelmon\species</code> folder. Drag the <code>001_bulbasaur.json</code> file into your <code>species</code> folder created earlier in the Datapack. Notice how the folders you created mimic the folders in the mod file. This is how Minecraft finds and reads the data.
 
# Open the <code>001_bulbasaur.json</code> file with a text editor of your choice.
 
# Scroll all the way down to this section of code:
 
#: <pre>"types": [&#10;    "GRASS",&#10;    "POISON"&#10;  ]</pre>
 
# Remove the part that says GRASS and replace it with FIRE. '''Ensure you keep the quotation marks <code>""</code> and the comma <code>,</code>.''' Save your file
 
# Launch Minecraft and load your world the datapack is located in.
 
# Type <code>/datapack list</code> to ensure your Datapack has loaded.
 
# Give yourself a Bulbasaur. <code>/pokegive [user] bulbasaur</code> and check its summary. If the icon for Fire is there, congratulations! You have created a Datapack that changed Bulbasaur into a Fire-Poison type.  
 
  
 +
* The <code>conditions</code> 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 the <code>terms</code> section. Furthermore, the last <code>condition</code> section is what defines the typing that is checked in order for this loot table to apply. The above example uses <code>minecraft:all_of</code> which means all types of raids (Bug, Fairy, Psychic etc) will use this loot table.
  
==Troubleshooting==
+
Below is a section of the <code>raids.json</code> which defines the loot table for 2-star level Grass Raids.
 +
 
 +
<spoiler text="Show">
 +
<div onload="prettyPrint()">
 +
<pre class="prettyprint">
 +
    {
 +
      "rolls": {
 +
        "min": 1.0,
 +
        "max": 5.0,
 +
        "type": "minecraft:uniform"
 +
      },
 +
      "bonus_rolls": 0.0,
 +
      "name": "raid",
 +
      "entries": [
 +
        {
 +
          "name": "pixelmon:miracle_seed",
 +
          "weight": 5,
 +
          "type": "minecraft:item"
 +
        },
 +
        {
 +
          "value": "pixelmon:intermediate/grass",
 +
          "weight": 50,
 +
          "type": "minecraft:loot_table"
 +
        },
 +
        {
 +
          "name": "pixelmon:tamato_berry",
 +
          "weight": 50,
 +
          "type": "minecraft:item"
 +
        },
 +
        {
 +
          "name": "pixelmon:aguav_berry",
 +
          "weight": 50,
 +
          "type": "minecraft:item"
 +
        },
 +
        {
 +
          "name": "pixelmon:pomeg_berry",
 +
          "weight": 50,
 +
          "type": "minecraft:item"
 +
        },
 +
        {
 +
          "name": "pixelmon:iapapa_berry",
 +
          "weight": 50,
 +
          "type": "minecraft:item"
 +
        },
 +
        {
 +
          "name": "pixelmon:tiny_mushroom",
 +
          "weight": 30,
 +
          "type": "minecraft:item"
 +
        },
 +
        {
 +
          "name": "pixelmon:big_mushroom",
 +
          "weight": 20,
 +
          "type": "minecraft:item"
 +
        },
 +
        {
 +
          "name": "pixelmon:balm_mushroom",
 +
          "weight": 10,
 +
          "type": "minecraft:item"
 +
        },
 +
        {
 +
          "name": "pixelmon:leaf_stone",
 +
          "weight": 25,
 +
          "type": "minecraft:item"
 +
        }
 +
      ],
 +
      "conditions": [
 +
        {
 +
          "terms": [
 +
            {
 +
              "stars": 2,
 +
              "condition": "pixelmon:star_level"
 +
            },
 +
            {
 +
              "terms": [
 +
                {
 +
                  "type": "Grass",
 +
                  "condition": "pixelmon:secondary_type"
 +
                },
 +
                {
 +
                  "type": "Grass",
 +
                  "condition": "pixelmon:secondary_type"
 +
                }
 +
              ],
 +
              "condition": "minecraft:any_of"
 +
            }
 +
          ],
 +
          "condition": "minecraft:all_of"
 +
        }
 +
      ]
 +
    }
 +
</pre>
 +
</div>
 +
</spoiler>
 +
 
 +
* 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 <code>value</code> of <code>pixelmon:intermediate/grass</code> 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 in <code>pixelmon\loot_table_intermediate</code> path.
 +
 
 +
* This example also uses different conditions as it is specific to 2-star Grass types raids. The <code>terms</code> have been set to include Grass as a <code>pixelmon:secondary_type</code>
 +
 
 +
==Raid Spawns==
 +
 
 +
Raid spawns, as of 9.3.0, are now defined per Pokémon species. These files can be access through the <code>pixelmon\pixelmon\raid\spawn\</code> 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]].
 +
 
 +
<pre>{
 +
  "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
 +
    }
 +
  ]
 +
}</pre>
 +
 
 +
* The <code>spec</code> field is where the Species is defined along with any additional [[Pokemon spec]] which can be added, such as forms and palettes.
 +
* The <code>loot_table</code> field is what Loot table is to be used for this Pokemon. By default, Bulbasaur will use the standard loot tables in the <code>raids.json</code> file however this can be changed.
 +
* The <code>stars</code> field is

Latest revision as of 22:11, 10 May 2025

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.

Show


  • 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 the terms section. Furthermore, the last condition section is what defines the typing that is checked in order for this loot table to apply. The above example uses minecraft: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.

Show


  • 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 of pixelmon: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 in pixelmon\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 a pixelmon: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 the raids.json file however this can be changed.
  • The stars field is

© 2012 - 2025 Pixelmon Mod