pluginiPlugin

Config

Config File

config.yml
# Zaphkiel Main Configuration File
 
# Database Configuration
Database:
  # Whether to enable database storage
  enable: false
  # MySQL server address
  host: localhost
  # MySQL port
  port: 3306
  # Database username
  user: root
  # Database password
  password: root
  # Database name
  database: minecraft
  # Table prefix
  prefix: zaphkiel
 
# Durability Display Settings
Durability:
  # Durability display format; %symbol% will be replaced with the actual durability bar
  display: '&8[ &f%symbol% &8]'
  # Durability display symbols
  display-symbol:
    # Symbol for the damaged part
    0: 
    # Symbol for the undamaged part
    1: 

Configuration Description

Configuration ItemDefault ValueDescription
Database.enablefalseWhether to enable MySQL database storage; SQLite is used when set to false
Database.hostlocalhostMySQL server address
Database.port3306MySQL server port
Database.userrootMySQL database username
Database.passwordrootMySQL database password
Database.databaseminecraftMySQL database name
Database.prefixzaphkielDatabase 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.0Display symbol for the damaged part in the durability progress bar
Durability.display-symbol.1Display 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

On this page