Skip to content

Database & Storage

Tebrox edited this page Sep 20, 2026 · 1 revision

Database & Storage

AFK Area uses VertexCore's persistence layer for AFK areas, households, completed session history and player statistics.

The backend is configured in config.yml.

Supported backends

json
h2
mysql

The mysql backend can be used with compatible MySQL or MariaDB servers.

JSON

Default:

database:
  backend: json

JSON needs no external database.

VertexCore stores flat-file records below:

plugins/AFKArea/data/

Records are separated into backend-managed table directories and stored as JSON files.

H2

database:
  backend: h2

H2 uses a local database rooted at:

plugins/AFKArea/database

No external database server is required.

MySQL / MariaDB

Example:

database:
  backend: mysql
  mysql:
    url: "jdbc:mysql://localhost:3306/minecraft"
    user: "minecraft"
    password: "your-password"

The JDBC URL and user must be set when mysql is selected.

Common settings

database:
  use-queue: true
  timeout-millis: 5000
  pool-size: 5
  table-prefix: afkarea_

use-queue

Uses VertexCore's queued asynchronous database execution.

Default:

true

timeout-millis

Default:

5000

Must be greater than 0.

pool-size

Maximum JDBC connection-pool size.

Default:

5

Must be greater than 0.

table-prefix

Default:

afkarea_

May contain only letters, numbers and underscores.

What is stored

Areas

  • Technical ID
  • Display name
  • Enabled state
  • Priority
  • Region definition
  • Teleport destination
  • Reward configuration

Households

  • Household ID
  • Member UUIDs

Session history

Completed AFK area sessions.

Player statistics

  • Session count
  • Total time
  • Longest session
  • Last session
  • Last area
  • Last session end time

Changing database settings

Database settings are initialized at startup.

If they are changed and /afkarea reload is used, the new database settings do not take effect until a server restart.

Restart after changing:

  • Backend
  • JDBC URL
  • User/password
  • Pool size
  • Table prefix

Moving between backends

Changing database.backend changes the active storage backend.

AFK Area does not provide an in-game migration command between JSON, H2 and MySQL.

Before changing an existing server:

  1. Stop the server.
  2. Back up plugins/AFKArea and any external database.
  3. Plan the data transfer.
  4. Change the backend settings.
  5. Start and verify the new backend before removing old data.

Backups

For JSON or H2, back up:

plugins/AFKArea/

For MySQL/MariaDB, also use your database server's normal backup tools.

Related pages

Clone this wiki locally