Join our discord
In partnership with NodeCraft Logo NodeCraft


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

Samosa's Playground

From Pixelmon Wiki
Revision as of 19:55, 24 April 2023 by Lord Samosa (talk | contribs) (datapack creation page, WIP)

Certain aspects of Pixelmon, such as species, NPCs, drops and structures can be edited through JSON files. These files can be accessed by using a program such as Winrar or 7-Zip to open the Pixelmon mod JAR file, and must be applied using a 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 Virtual Studio Code or Notepad++.

External JSON files should be edited carefully, as bad edits can potentially result in unexpected behavior from Pixelmon. Certain tools (such as JSONLint) can be used to verify that files are formatted correctly. 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:

File type Description
Advancements Governs advancements obtained from doing certain actions. These use the Minecraft advancement JSON format.
Boss Tiers Governs Boss Pokemon tiers, including their drops, mega specifications and colour.
Config Governs several different configuration files, including Starter specs, Shopkeeper items, the Better Spawner config, Traders and NPC Trainer textures.
Daycare Governs Daycare settings, including the item costs and hour costs for each type.
Dimension Governs settings for Ultra Space and Drowned World, such as the biomes that are generated and structures.
Drops Governs settings for Drops, including Pokemon drops, Pokeloot, Raids and imprint amounts for TRs and TMs.
Loot Table Governs settings for Loot tables used in Pixelmon Structures and Pokestop loot along with block drops.
Moves Governs configuration files for each Move and is where custom-created Moves are located.
NPCs Governs many Pixelmon NPC-related settings, such as Shopkeeper NPCs, NPC Trainer sets and Chatting NPCs.
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.
Quests Governs default and custom quests.
Raids Governs which Pokémon can spawn in Raid Dens in which biome and at what Star level(s).
Recipes Governs configuration files for all Recipes in Pixelmon, including recipes used in the Infuser and Vanilla machines.
Ribbons Governs configuration files for the various Marks and Ribbons in Pixelmon. This is where custom Marks and Ribbons will be located
Rules Governs rulesets and tiers for competitive battling.
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.
Spawning Governs what Pokémon spawn where, when and how. Includes fishing, bosses and Cave Rock/Grass spawns. This also includes NPC spawning files.
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.
Structures Governs what structures can spawn, and where. This is where structure files are located to be edited. Only affects new chunks.
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.

Creating a Data pack

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 here

1. You can easily go to the Datapacks folder by going in-game, hitting Edit on a world and opening the World folder.
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.
  1. 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.
  2. 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, My_Example_Datapack is suitable.
  3. In your Datapack folder, right click and create a Text Document called pack.mcmeta. 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.
  4. 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:
    {
      "pack": {
        "pack_format": 6,
        "description": "My test datapack"
      }
    }
  5. Create a new folder called data. Go into this folder. Create a folder called pixelmon.
    • Note: You should now have a working empty Datapack. To verify this, go into your world and type /datapack list. If you wish to see how to create an example Datapack, continue reading.
  6. 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.
  7. 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 here. Instead of going to config, go to mods.
  8. Right click the Pixelmon mod file (typically named Pixelmon-(MC version)-(MOD VERSION)-universal). Open it with your preferred archiver tool. Most commonly used ones are Winrar or 7-Zip.
  9. Go into the data\pixelmon\species folder. Drag the 001_bulbasaur.json file into your species 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.
  10. Open the 001_bulbasaur.json file with a text editor of your choice.
  11. Scroll all the way down to this section of code:
    "types": [
        "GRASS",
        "POISON"
      ]
  12. Remove the part that says GRASS and replace it with FIRE. Ensure you keep the quotation marks "" and the comma ,. Save your file
  13. Launch Minecraft and load your world the datapack is located in.
  14. Type /datapack list to ensure your Datapack has loaded.
  15. Give yourself a Bulbasaur. /pokegive [user] bulbasaur 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

© 2012 - 2025 Pixelmon Mod