Data Storage

🧭 Overview

The plugin supports two main storage methods for saving player and game data:

  • Local (JSON Files) β€” Easy to access and modify directly.

  • MySQL Database β€” Recommended for larger servers or multi-instance setups.

All player data, statistics, and settings are stored in structured JSON files by default, ensuring easy manual editing when needed.

  • Switching between local and MySQL storage can be done at any time β€” just restart the server after changing settings.

  • Player data is saved in JSON format, making it easy to manually view or edit stats.

  • For multi-server environments (e.g., Bungee or Velocity networks), MySQL is strongly recommended.


πŸ“ File Structure

All data is located in the /ArenaLegends/data/ directory.

Path
Description

/data/settings.yml

Contains various local plugin settings.

/data/metrics.yml

Used for tracking plugin metrics and analytics.

/data/players/

Stores individual player data files in JSON format.

Example structure:

/ArenaLegends/
 └── data/
     β”œβ”€β”€ settings.yml
     β”œβ”€β”€ metrics.yml
     └── players/
         β”œβ”€β”€ Notch.json
         β”œβ”€β”€ Steve.json
         └── Alex.json

πŸ—„οΈ MySQL Integration

You can switch from local file storage to MySQL for centralized and scalable data management.

How to Enable MySQL

  1. Open your main configuration file:

    /ArenaLegends/config.yml
  2. Locate the mysql-settings section.

  3. Set enabled to true.

  4. Fill in your database credentials (host, port, database, username, password).

βš™οΈ Configuration

mysql:
  connection:
    # Turn on/off the MySQL connection.
    enabled: false
    # The address to connect to the database.
    url: "jdbc:mysql://{HOST}:{PORT}/{NAME}"
    # The highest number of connections allowed at once.
    maximum-pool-size: 10
    # The lowest number of spare connections to keep ready.
    minimum-idle: 5
    # How long a connection can exist (in milliseconds).
    max-lifetime: 1800000
    # How long an unused connection stays open (in milliseconds).
    idle-timeout: 600000
    # How long to wait for a connection before giving up (in milliseconds).
    connection-timeout: 30000
    # Time to wait before warning about a stuck connection (in milliseconds).
    leak-detection-threshold: 60000
    # Automatically save database changes.
    auto-commit: true
  credentials:
    # The computer address where MySQL is running.
    host: "value"
    # The connection port number for MySQL.
    port: "3306"
    # The name of your database.
    name: "value"
    # Your MySQL username.
    user: "value"
    # Your MySQL password.
    pass: "value"

Last updated