Where the plugin keeps player stats and how to switch between SQLite and MySQL.
The plugin stores player stats (kills, wins, streaks, and so on) in a database. SQLite is the default and needs no setup. MySQL is optional, for sharing stats across several servers.
Runtime drivers
The database drivers are not bundled inside the plugin jar. On the first server start, the plugin downloads the SQLite and MySQL drivers from Maven Central and loads them. This keeps the jar small and works on both Spigot and Paper.
The drivers are cached in:
plugins/TNTGamesCore/libs/
Warning
The first start needs internet access to fetch the drivers. On an offline server, copy the driver jars into plugins/TNTGamesCore/libs/ from a machine that has them, then start the server.
SQLite (default)
Nothing to configure. The plugin creates a stats.db file in its data folder:
plugins/TNTGamesCore/stats.db
In config.yml:
database:
enabled: false # false = SQLite
Good for a single server. The file lives with the rest of your plugin data, so backing it up is just copying the folder.
MySQL (optional)
Use MySQL to share stats across a network. Set enabled: true and fill in the connection details:
database:
enabled: true
host: localhost
port: 3306
database: tntgames
username: root
password: changeme
- 1
Create the database
Make an empty database (for example
tntgames) and a user that can access it. - 2
Fill in config.yml
Set
enabled: trueand enter the host, port, database, username, and password. - 3
Restart the server
Restart so the plugin connects. The console prints
Connected to MySQL database!on success. - Configuration: the
databaseblock. - Scoreboards and stats: what gets tracked.
:::
The plugin creates its stats table automatically on first connect. You do not need to run any SQL.
Note
If the plugin cannot connect, it logs the error and continues running; stats just will not save. Check the host, port, and credentials, then reload or restart.