Database editing
From Pixelmon Wiki
Pixelmon uses an H2 database to store a variety of Pokémon data, including stats, moves, and spawn biomes. It is possible to edit the database to change these aspects.
Contents
Notes
Before attempting to edit the database, there are a few notes to keep in mind.
- Knowledge of SQL is not required to edit the database because the default H2 console GUI has a visual editor that provides the functionality of simpler SQL commands. However, knowledge of relational databases will provide a significant advantage in understanding the Pixelmon database structure, and knowing how to construct SQL queries will allow data to be manipulated much more easily.
- This guide uses the default H2 console to edit the database. It is possible to use other database editors such as SQuirreL SQL, but this guide will not include any features and installation steps for these alternate editors.
- Most database modifications only need to be done server-side. However, certain fields in the database are used client-side; if editing these fields, the custom database should be provided to players on the server to install client-side. If a field is used client-side, it will be mentioned as such.
- This guide assumes that the database is being modified for a server. However, it is also possible to modify the database on singleplayer by following similar steps.
Setting up a custom database
- If you haven't already, run the server with Pixelmon installed in order to generate a "database" folder in the root Minecraft directory.
- In the root Minecraft directory, create a "customdatabase" folder.
- Copy the "Pixelmon2.h2.db" file from the "database" folder to the "customdatabase" folder.
- In the database folder, run the "h2-<numbers>.jar" file. This will open a window in your internet browser with the H2 console.
- In the "JDBC URL" text box, put "jdbc:h2:" followed by the full file path to the "Pixelmon2.h2.db" file inside the "customdatabase" folder. Include a slash at the beginning of the path, and omit the ".h2.db" extension from the file name (i.e., just use "Pixelmon2"). Leave the "User Name" and "Password" fields blank.
- Click the "Connect" button.
- You should see a screen similar to the image below. Make sure that you can see a list of database table names on the left sidebar; if you cannot, you did not connect to the database correctly.
Editing database tables
Note: If you know how to use SQL queries to edit the database, you can skip this section.
- To view a table, click on its entry in the left sidebar.
- To edit a table after viewing it, scroll to the bottom of the table and click the "Edit" button.
- To edit an existing row, click the
icon in the row you want to edit. The row's values will become editable text boxes. Again, click the
icon on the left to save the row, or click the
icon to cancel the modification.
- To delete a row, click the
icon on the left of the row you want to delete.
Tables
Table | Used | Can edit | Can add | Can delete |
---|---|---|---|---|
ABILITIES | Yes | No | No | No |
BADGES | No | N/A | N/A | N/A |
BIOMES | Yes | No | Yes | No |
CUSTOM_DROPS | No | N/A | N/A | N/A |
CUSTOM_MESSAGES | No | N/A | N/A | N/A |
CUSTOM_TEAMMEMBERS | No | N/A | N/A | N/A |
CUSTOM_TRAINER | No | N/A | N/A | N/A |
EGGGROUPS | Yes | No | Yes | No |
HMREQUIREMENTS | No | N/A | N/A | N/A |
MOVEANIMATIONS | No | N/A | N/A | N/A |
MOVECATEGORIES | Yes | No | No | No |
MOVEEFFECTS | No | N/A | N/A | N/A |
MOVES | Yes | Yes | Yes | No |
PIXELMON | Yes | Yes | No | No |
PIXELMONDROPS | Yes | Yes | Yes | Yes |
PIXELMONEGGSKILLS | Yes | Yes | Yes | Yes |
PIXELMONEVOLUTIONS | Yes | Yes | Yes | Yes |
PIXELMONFLY | Yes | Yes | Yes | No |
PIXELMONHELDITEMS | No | N/A | N/A | N/A |
PIXELMONLEVELSKILLS | Yes | Yes | Yes | Yes |
PIXELMONRIDE | Yes | Yes | Yes | No |
PIXELMONSPAWNBIOMES | Yes | Yes | Yes | Yes |
PIXELMONSPAWNLOCATIONS | Yes | Yes | Yes | Yes |
PIXELMONSPAWNTIMES | Yes | Yes | Yes | No |
PIXELMONSWIM | Yes | Yes | Yes | No |
PIXELMONTMHMSKILLS | Yes | Yes | Yes | Yes |
PIXELMONTRADES | Yes | Yes | Yes | Yes |
PIXELMONTUTORSKILLS | Yes | Yes | Yes | Yes |
SHOPITEMS | No | N/A | N/A | N/A |
SHOPKEEPERITEMS | No | N/A | N/A | N/A |
SHOPKEEPERS | No | N/A | N/A | N/A |
TRAINER | No | N/A | N/A | N/A |
TRAINERDROPS | No | N/A | N/A | N/A |
TRAINERMESSAGES | No | N/A | N/A | N/A |
TRAINERPIXELMONPOOL | No | N/A | N/A | N/A |
TRAINERSPAWNBIOMES | Yes | Yes | Yes | Yes |
TRAINERTYPES | Yes | No | Yes | No |
TYPES | Yes | No | No | No |
ABILITIES
This table assigns numerical IDs to all Abilities. This table should not be modified.
BADGES
This table is not currently used by Pixelmon.
BIOMES
This table assigns numerical IDs to all biomes. This table should not be modified.
CUSTOM_DROPS
This table is not currently used by Pixelmon.