forked from sulphi-fox/ChatColor2
-
Notifications
You must be signed in to change notification settings - Fork 0
SQL Storage
TejasLamba2006 edited this page Jul 26, 2026
·
1 revision
ChatColor3 can store player data in MySQL or MariaDB instead of YAML files.
- Create a database (the plugin can also auto-create it):
CREATE DATABASE chatcolor_db;- Edit
plugins/ChatColor3/config.yml:
storage:
type: sql
database:
address: localhost
port: 3306
name: chatcolor_db
user: database_user
password: database_password- Restart the server (storage type cannot be changed with
/chatcolor reload).
The plugin auto-creates the table chatcolor_players:
CREATE TABLE chatcolor_players (
UUID VARCHAR(255) PRIMARY KEY,
Colour VARCHAR(255),
DefaultCode BIGINT
);- The MariaDB JDBC driver and HikariCP connection pool are bundled (shaded) in the plugin jar — no external dependencies needed.
- All database operations run asynchronously to avoid blocking the main thread.
- Player data is cached in memory and written through on change.
- On shutdown, any unsaved data is flushed.
There is no automatic migration tool. To migrate:
- Stop the server
- Set
storage.typetosqland configure the database - Start the server (creates the table)
- Manually copy data from
players/*.ymlfiles into the database, or let players re-set their colours