Storage
Player progress is saved to a database. SQLite works out of the box, MySQL is optional.
Pick a backend
- SQLite (default)
- MySQL
With no setup, the plugin stores everything in a single data.db file inside the
zCollections folder. This is the right choice for a single server. There is nothing to
install or configure.
storage:
type: sqlite
If you run one server, stay on SQLite. It is the simplest option and needs zero setup.
Use MySQL when you want several servers to share the same progress, like a network where players carry collections between servers.
storage:
type: mysql
mysql:
host: localhost
port: 3306
database: zcollections
username: root
password: ''
use-ssl: false
pool-size: 10
| Setting | What it is |
|---|---|
host | The database server address |
port | The database port, usually 3306 |
database | The database name, must already exist |
username | The login user |
password | The login password |
use-ssl | Use an encrypted connection |
pool-size | How many connections to keep open |
Setup steps
- Create an empty database (for example
zcollections) on your MySQL server. - Set
typetomysqland fill in themysqlblock. - Run
/collection reloador restart the server.
The plugin creates its tables automatically inside the database you named.
Make sure the database exists and the user can reach it before you switch. If the plugin cannot connect, it will not enable, and the console will show the connection error.
When data is saved
Player data is written to the database in three cases:
- On a timer, set by
save-intervalinconfig.yml. - When a player logs out.
- When the server stops.
Switching backends later
Switching between SQLite and MySQL does not copy existing progress between them. Plan your storage before players build up data, or be ready to start fresh on the new backend.