Config
Config File
Configuration Description
Configuration Item | Default Value | Description |
---|---|---|
Database.enable | false | Whether to enable MySQL database storage; SQLite is used when set to false |
Database.host | localhost | MySQL server address |
Database.port | 3306 | MySQL server port |
Database.user | root | MySQL database username |
Database.password | root | MySQL database password |
Database.database | minecraft | MySQL database name |
Database.prefix | zaphkiel | Database table prefix |
Durability.display | '&8[ &f%symbol% &8]' | Durability display format template; the %symbol% placeholder will be replaced with the durability bar |
Durability.display-symbol.0 | ◆ | Display symbol for the damaged part in the durability progress bar |
Durability.display-symbol.1 | ◇ | Display symbol for the undamaged part in the durability progress bar |
Main Uses of the Database
1. Item Serialization Storage
Zaphkiel's database is mainly used to store serialized item data. The system can convert items into JSON format for storage.
2. Supported Storage Methods
Based on the Database.enable
setting in the configuration file:
MySQL (enable: true
):
- Uses MySQL database for storage
- Supports cross-server data sharing
- Suitable for large-scale server networks
SQLite (enable: false
):
- Uses local SQLite database
- Data is stored in local files
- Suitable for single-server environments
3. Serialized Data Structure
The serialized item can be seen to include:
- id: Item identifier
- amount: Item quantity
- data: Custom item data
- unique: Unique identification data (including player info, timestamp, UUID, etc.)
4. Practical Application Scenarios
Database storage is mainly used for:
- Cross-server item synchronization: Sharing player item data across multi-server networks
- Item persistence: Saving players' custom items to prevent data loss
- Item tracking: Tracking specific item instances via unique identifiers
- Data backup: Backing up important item data to the database