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 (Text replacement - "https://minecraft.fandom.com/wiki" to "https://minecraft.wiki")
m
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
__TOC__
+
<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."/>
 +
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.
  
Certain aspects of Pixelmon, such  as species, [[NPCs]], [[drops]] and [[structures]] can be edited through [https://www.json.org/ JSON] files.
+
==Loot Tables==
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.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++].
 
  
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.
+
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.
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.  
 
  
There are several 3rd-party tools that can be used to generate JSON files for Datapacks. For example, there is [https://misode.github.io/generators/ Misode's Generators] and [https://minecraft.tools/en/ Minecraft Tools].
+
Below is a section of the <code>raids.json</code> file which defines loot available for all type 1-star raids.
  
==Datapackable Files==
+
<spoiler text="Show">
The following types of files can currently be edited via a datapack:
+
<div onload="prettyPrint()">
{|class="wikitable"
+
<pre class="prettyprint">
|-
+
    {
|style="text-align:center"|'''File type'''
+
      "rolls": {
|style="text-align:center"|'''Description'''
+
        "min": 1.0,
|-
+
        "max": 5.0,
|style="text-align:center"|[[Advancements JSONs|Advancements]]
+
        "type": "minecraft:uniform"
|Settings for [[advancements]] obtained from doing certain actions. These use the [https://minecraft.wiki/Advancement/JSON_format Minecraft advancement JSON format].
+
      },
|-
+
      "bonus_rolls": 0.0,
|style="text-align:center"|[[Boss Tiers JSONs|Boss Tiers]]
+
      "name": "raid",
|Governs [[Boss]] Pokemon tiers, including their drops, mega specifications and colour.
+
      "entries": [
|-
+
        {
|style="text-align:center"|[[Config JSONs|Config]]
+
          "name": "pixelmon:rare_candy",
|Controls several different configuration files, including [[Starter]] specs, [[Shopkeeper]] items, the [[Better_Spawner/Config|Better Spawner config]], [[Traders]] and NPC [[Trainer]] textures.
+
          "weight": 25,
|-
+
          "type": "minecraft:item"
|style="text-align:center"|[[Daycare JSONs|Daycare]]
+
        },
|Governs [[Daycare]] settings, including the item costs and hour costs for each type.
+
        {
|-
+
          "name": "pixelmon:ruby",
|style="text-align:center"|[[Dimension JSONs|Dimension]]
+
          "weight": 50,
|Governs settings for [[Ultra Space]] and [[Drowned World]], such as the biomes that are generated and structures.
+
          "type": "minecraft:item"
|-
+
        },
|style="text-align:center"|[[Drop JSONs|Drops]]
+
        {
|Governs settings for [[Drops]], including Pokemon drops, [[Pokeloot]], [[Raids]] and imprint amounts for [[TRs]] and  [[TMs]].
+
          "name": "pixelmon:sapphire",
|-
+
          "weight": 50,
|style="text-align:center"|[[Loot Table JSONs|Loot Table]]
+
          "type": "minecraft:item"
|Governs settings for Loot tables used in Pixelmon Structures and [[Pokestop]] loot along with block drops.
+
        },
|-
+
        {
|style="text-align:center"|[[Move JSONs|Moves]]
+
          "name": "minecraft:amethyst_shard",
|Governs configuration files for each [[Move]] and is where custom-created Moves are located.
+
          "weight": 50,
|-
+
          "type": "minecraft:item"
|style="text-align:center"|[[NPC JSONs|NPCs]]
+
        },
|Controls many [[NPCs|Pixelmon NPC]]-related settings, such as [[Shopkeeper]] NPCs, NPC [[Trainer]] sets and [[Chatting NPCs]].
+
        {
|-
+
          "name": "pixelmon:crystal",
|style="text-align:center"|[[Pokeball JSONs|Pokeballs]]
+
          "weight": 50,
|Holds configuration files for [[Pokeballs]] such as controlling the assets used, the capture method and logic used. This is where custom Pokeballs should be located.
+
          "type": "minecraft:item"
|-
+
        },
|style="text-align:center"|[[Quests/Creation|Quests]]
+
        {
|Governs default and custom [[quests]].
+
          "name": "pixelmon:dynamax_candy",
|-
+
          "weight": 100,
|style="text-align:center"|[[Raid JSON|Raids]]
+
          "type": "minecraft:item"
|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]]
+
          "name": "pixelmon:xs_exp_candy",
|Governs configuration files for all [[Recipes]] in Pixelmon, including recipes used in the [[Infuser]] and Vanilla machines.
+
          "weight": 100,
|-
+
          "type": "minecraft:item"
|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
+
        {
|-
+
          "name": "pixelmon:s_exp_candy",
|style="text-align:center"|[[Rule JSONs|Rules]]
+
          "weight": 100,
|Governs rulesets and tiers for competitive battling.
+
          "type": "minecraft:item"
|-
+
        }
|style="text-align:center"|[[Spawn Replacement JSONs|Spawn Replacement]]
+
      ],
|Controls 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.
+
      "conditions": [
|-
+
        {
|style="text-align:center"|[[Spawning JSONs|Spawning]]
+
          "terms": [
|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.
+
            {
|-
+
              "stars": 1,
|style="text-align:center"|[[Species JSONs|Species]]
+
              "condition": "pixelmon:star_level"
|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]]
+
          "condition": "minecraft:all_of"
|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.
+
</pre>
|}
+
</div>
 +
</spoiler>
  
'''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.
+
* 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.  
  
== Creating a Data pack ==
+
* 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.
  
'''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.wiki/Tutorials/Creating_a_data_pack here]. A video guide can also be found [https://youtu.be/oTbw7clqnwo here].'''
+
* 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.
[[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.
+
Below is a section of the <code>raids.json</code> which defines the loot table for 2-star level Grass Raids.  
# 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.  
 
  
==Troubleshooting==
+
<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>
  
If your Datapack does not function how it should or an error appears when loading into your world, then you must debug it. This section will guide you on how to debug and resolve common issues with Datapacks.  
+
* 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.
  
===Check your logs===
+
* 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>
  
The main step is to read your logs. As the game runs, it reports back information on what's going on at the time, including any errors. For help finding your logs, see [https://pixelmonmod.com/wiki/Finding_your_logs Finding your logs]
+
==Raid Spawns==
  
*Couldn't parse data file pixelmon:[Insert file] from pixelmon:[file path] <code>com.google.gson.JsonParseException: com.google.gson.stream.MalformedJsonException:</code> Unterminated object at [Position] path [Line/broken code]
+
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.
  
This error means your file is '''invalid'''. This typically means there is a syntax error with your file. Example could be a missing comma <code>,</code> or any missing element. To resolve this, copy and paste your entire file and run it through a JSOn validator as mentioned earlier. One can be found [https://jsonlint.com/ here].
+
Below is the default spawning JSON for [[Bulbasaur]].
-----
 
*[main/ERROR] [Pixelmon/]: Cannot find ability with name '[Ability]'!
 
  
This error means you have added an abiltiy to a Pokemon that is incorrect. This could either be a misspelt Ability or the Ability format is wrong. For example, <code>Compound Eyes</code> is incorrect and would cause this error. However <code>CompoundEyes</code> will work fine.  
+
<pre>{
-----
+
  "spawns": [
*[main/WARN] [Pixelmon/]: Attack name invalid: [Move]
+
    {
 +
      "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>
  
This error means you have given a Pokemon with an incorrect move. This could either be a misspelt Move or the Move format is wrong. If this error is present in logs but you have not touched the move or added it in any way, it can be safely ignored.
+
* 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.  
*[Server thread/WARN] [minecraft/ResourcePackInfo]: Couldn't get pack info for: net.minecraft.resources.ResourcePackFileNotFoundException: 'pack.mcmeta' in ResourcePack '.\world\datapacks\[Datapack].zip'
+
* The <code>stars</code> field is
 
 
This means your <code>pack.mcmeta</code> file is invalid or missing. This can be caused by a syntax error in the file itself or you have structured the datapack incorrectly. To structure it correctly, always ensure the base Datapack folder goes directly to the <code>data</code> folder. For example, the file path <code>My Datapack.zip\My Datapack\data\pixelmon</code> is incorrect. Minecraft will not look further. The correct file path would be <code>Incorrect Structure.zip\data\pixelmon</code> (The Datapack itself can be a regular folder, does not need to be zipped). Zipped Datapacks do not need to be unzipped if downloaded from external sources.
 
-----
 
*Caused by: java.lang.IllegalArgumentException: No enum constant com.pixelmonmod.pixelmon.api.pokemon.species.gender.Gender.FEALE
 
*Caused by: java.lang.IllegalArgumentException: No enum constant com.pixelmonmod.pixelmon.api.pokemon.Element.POSON
 
 
 
An error that references Java code or "No enum constant" typically means a hard-coded aspect of Pixelmon is incorrect/mispelt. The error should further clarify what part of the Pokemon is wrong, such as Element (Type) or "Gender".
 
 
 
===Other problems===
 
 
 
If the above errors do not match your issues or you require further assistance, post the log in a website such as [https://pastebin.com/ Pastebin], and post the resulting link in either the [[Pixelmon forum]]'s [https://forum.pixelmonmod.com/tracker.php?p=4 support tracker] or the [[Pixelmon Discord]]'s #log-upload channel and ask for assistance in the #datapack-support channel.
 

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