Join our discord
In partnership with NodeCraft Logo NodeCraft


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

Database editing

From Pixelmon Wiki
Revision as of 18:16, 4 January 2017 by Some body (talk | contribs) (Created page with "Pixelmon uses an [http://www.h2database.com/html/main.html H2 database] to store a variety of Pokémon data, including stats, moves, and spawn biomes. It is possible t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.

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

The initial screen displayed when running the H2 console
  1. If you haven't already, run the server with Pixelmon installed in order to generate a "database" folder in the root Minecraft directory.
  2. In the root Minecraft directory, create a "customdatabase" folder.
  3. Copy the "Pixelmon2.h2.db" file from the "database" folder to the "customdatabase" folder.
  4. In the database folder, run the "h2-<numbers>.jar" file. This will open a window in your internet browser with the H2 console.
  5. 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.
  6. Click the "Connect" button.
  7. 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.
The H2 console after connecting to the Pixelmon database

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 add a new row to the table, click the DatabaseInsert.png icon and fill in each column's values. Once you have done this, click the DatabaseConfirm.png icon on the left to save the row. You can click the DatabaseCancel.png icon to cancel adding a row.
  • To edit an existing row, click the DatabaseUpdate.png icon in the row you want to edit. The row's values will become editable text boxes. Again, click the DatabaseConfirm.png icon on the left to save the row, or click the DatabaseCancel.png icon to cancel the modification.
  • To delete a row, click the DatabaseDelete.png 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.

© 2012 - 2025 Pixelmon Mod