Skip to content

Configuration

snazzyatoms edited this page Apr 9, 2026 · 1 revision

This page explains the main configuration options for Coffers and Coffers Legacy.

Both plugin lines use a config.yml file, and both support the same major configuration areas:

  • Vault compatibility
  • Storage backend selection
  • Transaction history limits
  • Currency definitions
  • Currency formatting rules

Where the Config Comes From

The default configuration templates are included with each plugin line:

  • Modern line defaults: coffers-paper/src/main/resources/config.yml
  • Legacy line defaults: coffers-legacy/src/main/resources/config.yml

After first startup, the plugin will generate its configuration files inside its plugin data folder on the server.

Main Config Sections

The main sections are:

  • compatibility
  • storage
  • history
  • currencies

Vault Compatibility

The Vault bridge setting is controlled here:

compatibility:
  vault-bridge: auto

Available modes:

  • auto Register with Vault only when Vault is installed

  • enabled Force Coffers to expose a Vault economy provider when Vault is present

  • disabled Never register the Vault bridge

Recommended usage:

  • use auto for most servers
  • use enabled only if you specifically want Coffers to register whenever Vault is available
  • use disabled if you do not want Vault integration at all

Storage Configuration

The active storage backend is selected here:

storage:
  type: yaml

Supported values:

  • yaml
  • sqlite
  • mysql

YAML Storage

YAML is the simplest option and is enabled by default.

Modern line example:

storage:
  type: yaml
  yaml:
    accounts-file: accounts.yml
    history-file: history.yml

Legacy line example:

storage:
  type: yaml
  yaml:
    accounts-file: legacy-accounts.yml
    history-file: legacy-history.yml

Use YAML when:

  • your server is small
  • you want the simplest possible setup
  • you do not need a SQL database

SQLite Storage

SQLite stores data in a local database file on the server.

Modern line example:

storage:
  type: sqlite
  sqlite:
    file: coffers.db

Legacy line example:

storage:
  type: sqlite
  sqlite:
    file: coffers-legacy.db

Use SQLite when:

  • you want structured persistence
  • your economy lives on one server
  • you do not want to manage MySQL

MySQL Storage

MySQL is intended for larger setups or environments that need a shared database.

Modern line example:

storage:
  type: mysql
  mysql:
    host: localhost
    port: 3306
    database: coffers
    username: root
    password: change-me
    parameters: useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC

Legacy line example:

storage:
  type: mysql
  mysql:
    host: localhost
    port: 3306
    database: coffers_legacy
    username: root
    password: change-me
    parameters: useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC

Use MySQL when:

  • you run a larger server environment
  • you want central database storage
  • you are comfortable managing SQL credentials and database access

History Configuration

Transaction history size is controlled here:

history:
  max-per-account: 50

This value controls how many recent ledger entries are kept per account in storage.

You may want:

  • a lower value for smaller or lighter setups
  • a higher value if you want more account audit history

Currency Configuration

Currencies are defined in the currencies section.

Example:

currencies:
  default: coins
  definitions:
    coins:
      singular: coin
      plural: coins
      symbol: $
      fractional-digits: 2
      starting-balance: 100.00
      format:
        symbol-first: true
        space-between-symbol-and-amount: false
        space-between-amount-and-name: true
        use-grouping: true
        show-trailing-zeros: true

Each currency can define:

  • singular name
  • plural name
  • symbol
  • fractional digits
  • starting balance
  • display formatting rules

Default Currency

The default currency is set here:

currencies:
  default: coins

Important:

  • the default currency must exist in currencies.definitions
  • Coffers now validates this at startup
  • if the configured default currency is missing, startup will fail instead of silently using a broken configuration

Formatting Rules

Each currency can also define its own display rules.

Example:

format:
  symbol-first: true
  space-between-symbol-and-amount: false
  space-between-amount-and-name: true
  use-grouping: true
  show-trailing-zeros: true

These rules control how formatted balance output appears in commands and plugin displays.

Example Multi-Currency Setup

The default config includes coins and gems.

Example:

currencies:
  default: coins
  definitions:
    coins:
      singular: coin
      plural: coins
      symbol: $
      fractional-digits: 2
      starting-balance: 100.00
      format:
        symbol-first: true
        space-between-symbol-and-amount: false
        space-between-amount-and-name: true
        use-grouping: true
        show-trailing-zeros: true
    gems:
      singular: gem
      plural: gems
      symbol: 
      fractional-digits: 0
      starting-balance: 0
      format:
        symbol-first: false
        space-between-symbol-and-amount: true
        space-between-amount-and-name: true
        use-grouping: true
        show-trailing-zeros: false

Note:

  • the legacy config currently uses * as the sample gems symbol
  • the modern config currently uses

Recommended Starting Configs

Small server

  • storage type: yaml
  • history limit: 25 to 50
  • Vault mode: auto

Single-server production setup

  • storage type: sqlite
  • history limit: 50 or higher
  • Vault mode: auto

Larger or shared deployment

  • storage type: mysql
  • history limit: based on your storage and audit needs
  • Vault mode: auto or enabled, depending on your plugin environment

Common Configuration Mistakes

Avoid these common issues:

  • setting a default currency that is not defined
  • enabling MySQL without valid credentials
  • choosing the wrong storage type for your server setup
  • forgetting to restart after changing important settings
  • assuming the modern and legacy lines use identical file names for storage outputs

Clone this wiki locally