Skip to content
Configuration

Configuration

General

Four settings that do not belong to any one subsystem.

# Verbose cache, database and API messages. Database access from a tick thread
# is named in the console whenever the server runs; with debug on, also while
# it starts and stops.
debug: false

# Measure how long each plugin and addon spends in each event handler, read with
# /xcore profile. Addons run under XCore's plugin identity, so a timings report
# blames XCore for all of them; this tells you which one is costing tick time.
profiling: false

# Recognise a returning player whose UUID changed.
migrate-uuid-changes: true

# Answer /plugins with Paper's own list plus a section for the addons.
plugins-command:
  override: true

A file with a YAML mistake

A tab in front of a list entry is enough to make a whole file unreadable. Since 2.0.1, a config.yml, a language file or a dashboard strings file that cannot be read is left exactly as it is: nothing merges new settings into it, prunes it or saves over it, and the console says where the mistake is.

config.yml is not valid YAML: line 253, column 1: found character '\t(TAB)' that cannot start any token.
The file was left untouched. The default settings are used until it is fixed and the plugin reloaded.
  • A plugin built on XCore starts on its shipped settings until the line is fixed, and keeps the settings it had when the mistake arrives with a reload
  • XCore itself does not start on an unreadable config.yml, nor on an empty one: its defaults would point every plugin at an empty local database in place of the one you configured. The same goes for addons.yml, which says which plugins run and which of them share their data across servers. Fix the line and restart; /xcore reload on a file with a mistake keeps the settings from before and says so to whoever ran it
  • A language file gives way to the bundled texts until it is fixed

While XCore is not started, the plugins built on it are not either. On a server that has XLogin, every connection is refused until XCore starts, whichever form of XLogin is installed: an authentication that is not running must not leave the door open.

Before 2.0.1 the file was copied aside as <name>.unreadable-… and rebuilt from the defaults, without its lists. If such a copy sits next to a config.yml, the console points it out at every start: it is your own file, with everything you had set. Put back what is missing, then delete the copy.

When an update adds settings to a file, they arrive with the comments that explain them.

Profiling

Costs one boolean read per event while off, so leaving it off is free. /xcore profile on turns it on for a session without editing the file, and /xcore profile prints what it has gathered.

Database access on a tick thread

A query run on a tick thread makes the whole server wait for the database. XCore names the call site in the console the first time, with the plugin, the class and the line, then at most once every five minutes with a count. Startup and shutdown are left out unless debug is on.

UUID changes

server_uuid is derived from the name in offline mode and comes from Mojang in online mode. Switching that setting, or moving the server behind a proxy that changes it, makes every player look brand new. With this on, the existing row is moved onto the new UUID instead of a second one being created, so balances, per-plugin columns, pending deliveries and history follow the player.

A row is moved only in two cases: the connection proves its identity and it matches the Mojang UUID stored with the row, or the row carries exactly the same name, capitals included. Only a Mojang UUID proves who connects, and only online mode, a proxy that forwards Mojang UUIDs or XLogin's REAL mode hand one out. A name in other capitals is another player: an offline steve never takes Steve's account, he gets a fresh one and the console says so once. Two Mojang accounts are never matched by name, and when several rows could match, none is moved and the console warns.

The plugins' own data follows too. XCore moves its row during the player's login, then every plugin registered for it moves its own before its login checks run: XBans, XLogin and XAuctionHouse 2.0 all do. The whole recognition is bounded: about 10 seconds, 2 more for a move already under way, and 5.5 for the plugins. Past that the login goes on: a move that had not begun waits for the next login, and one already begun finishes in the background.

A plugin that stores data by UUID without registering for UUID changes (see the Developer Guide) leaves that data under the old UUID. XCore only moves the rows it owns.

The /plugins command

The X plugins are server plugins since 2.0, so /plugins lists them like any other. Addons in plugins/XCore/addons/ are loaded by XCore rather than by the server, so /plugins does not know they exist. With the override on, the command answers with Paper's own list plus a third section for the addons, and /bukkit:plugins and /bukkit:pl answer the same way so the two forms cannot disagree. Turn it off to hand the command back to the server exactly as it was.

Database

XCore supports SQLite (default, zero config), MySQL, and PostgreSQL.

database-type: sqlite    # sqlite, mysql, postgresql

database:
  host: localhost
  port: 3306
  name: xcore
  username: root
  password: ""
  pool-size: 10

Use MySQL or PostgreSQL for multi-server setups. SQLite is single-server only and doesn't support cross-server sync.

Cross-Server

The cross-server block controls Redis (L2 cache + instant Pub/Sub sync) and database polling (fallback sync). Both are configured together.

server-name: "default"           # at the root of config.yml

cross-server:
  enabled: false
  redis:
    enabled: false
    host: localhost
    port: 6379
    password: ""
    database: 0
    ttl: 3600
  heartbeat-seconds: 10          # how often a server announces itself to the others
  sync:
    poll-interval-seconds: 3       # Database polling interval (if no Redis)
    retention-seconds: 300         # How long to keep DB sync rows

Redis is the preferred transport (instant delivery). Database polling is the fallback with a configurable delay.

server-name identifies this server instance. It is used by plugins (e.g. per-server economy balances) and sync channels. Each plugin registers named channels. XCore multiplexes them over a single Redis channel (xcore:sync) or database table (xcore_sync).

Each channel has a protocol version, carried by every message. A server whose messages are of another version is not heard on that channel: the console names it once and says which side is behind. Update every server of a network together.

When a player's row changes, the server that wrote it tells the others so they drop their copy. Without that, a balance changed on one server stayed wrong everywhere else until the entry fell out of the cache.

The heartbeat is what feeds the server list, "which server is this player on", and messages addressed to one server in particular.

The switches that turn a plugin or an addon off (addons) and the ones that make it share its data across servers (sync-addons) are in a separate addons.yml file, not in config.yml.

Economy

XCore includes a full economy system with multi-currency support, Vault integration, and currency exchange.

economy:
  enabled: true
  per-server-balances: false      # Uses cross-server.server-name
  currencies:
    coins:
      symbol: "$"
      symbol-position: BEFORE     # BEFORE or AFTER
      decimals: 2
      starting-balance: 0.00
      max-balance: 1000000000
      vault: true                 # Primary Vault currency
    gems:
      symbol: "✦"
      symbol-position: AFTER
      decimals: 0
      starting-balance: 0
      max-balance: 0              # 0 = unlimited
      vault: false
  exchange:
    enabled: true
    rates:
      coins-to-gems: 100          # 100 coins = 1 gem
      gems-to-coins: 80           # 1 gem = 80 coins

The currency marked with vault: true becomes the primary Vault provider. All other plugins (shops, auction house, etc.) see this currency through Vault.

Set per-server-balances: true to maintain separate balances per server. The server identity comes from server-name at the root of the main config.

Web Dashboard

web-dashboard:
  enabled: true
  port: 8085
  bind-address: "0.0.0.0" # "127.0.0.1" behind a reverse proxy on the same machine
  session-ttl-hours: 24   # how long a /xcore dashboard link stays valid, 168 (a week) at most
  offline-trust-hours: 2  # how long a session lasts while its owner is not on this server, 0 = only while they are
  metrics-public: true
  cors-origin: "*"        # set your panel URL if the dashboard is reachable from the internet
  public-url: ""          # what /xcore dashboard links to, behind a proxy or a domain

Since 2.0 the dashboard has the look of celestis.dev, in a light and a dark theme, and works on a phone as well as on a desktop. Forms open in a dialog, actions ask for confirmation, and the browser loads nothing from the internet: player faces included, everything comes from your server.

Since 2.1 every item has its icon as the inventory shows it, a stair as a stair and a chest as a chest: your server draws it from the game's own models the first time it is shown, and keeps it in plugins/XCore/cache/icons/<version>/, so it is drawn once. The models and textures come from an asset mirror, through the server; when the mirror does not have a brand new Minecraft version yet, the newest one it holds stands in, and the icons drawn from it are drawn again after a week. Forms have number, switch, list, currency and item fields, the last with a search by name and the icons; a table can edit a row in place; and a page can show a container as a grid of slots, which is how XShop lays out its shops.

Each plugin registers a web module that declares its own pages, so the interface of a plugin lives with the plugin rather than in the core.

Logging in

There is no token to configure. Run /xcore dashboard in game and you get a link that opens the dashboard already authenticated, with your own permissions (see Dashboard Roles). The page takes the token out of the address bar on arrival, so it does not linger in the browser history or in a screenshot. The sidebar shows who is signed in, with a sign-out button.

Sessions are stored as SHA-256 hashes in web-sessions.json — a copy of that file lets nobody in. /xcore dashboard revoke closes every session you opened, and /xcore dashboard revoke <player> someone else's (with xcore.admin, from the console too). Links expire after session-ttl-hours: a week at most, so 0 or more than 168 counts as 168.

A script that needs API access gets its token the same way: run the command, take the token out of the link, revoke it when the script is retired. Like any session, it closes once its owner has been away from the server for offline-trust-hours (see Dashboard Roles).

Authentication is rate limited: ten failed attempts from the same address within a minute lock that source out. A request carrying a live session is always let in, so a reverse proxy that gives every reader the same address cannot shut a logged-in administrator out. All requests are limited to 120 per minute per address.

Dashboard Roles

Each staff member sees and does on the dashboard only what their in-game permissions allow. The server checks them on every request, and a refused request answers 403 naming the missing permission. None of these permissions is registered, so they all default to op: ops keep everything.

PermissionDescription
xcore.dashboardLog in and see the overview. /xcore dashboard gives the link, and so does /xcore alone for someone without xcore.admin. A session lasts only while its owner holds this permission
xcore.dashboard.playersThe players list and profiles, clickable player names and the Recent players card
xcore.dashboard.configRead the configuration editor of the modules the reader can open. Passwords, tokens, API keys and webhook addresses read <hidden>; saved back unchanged, <hidden> keeps the stored value
xcore.dashboard.config.saveSave a configuration from the editor, with xcore.dashboard.config, the module's own node and the plugin's save permission: XBans xbans.admin, XLogin xlogin.admin, XAuctionHouse ah.admin, XAntiLag xantilag.admin, XShop xshop.admin. A module that names none can only be saved by an operator. A configuration can make a plugin run console commands, so saving one is trusted like the console, and every save is logged with its author
xcore.dashboard.<module>A module's pages. The module name is in lower case: economy, xbans, xauctionhouse, xlogin, xantilag, xshop, and third-party modules alike
xcore.dashboard.<module>.manageThe module's actions that declare no permission of their own: every third-party action; XBans kick, freeze and notes. It does not cover saving a configuration
xcore.adminUnchanged: every /xcore subcommand except dashboard, plus /xcore dashboard revoke <player>, which closes someone else's sessions. It gives no dashboard access by itself

Actions take the command's permission

An action on a module's page needs, besides the page's own permission, the same permission as the matching command in game.

ActionPermission
XBans: ban / unbanxbans.ban / xbans.unban
XBans: IP ban / unbanxbans.banip / xbans.unbanip
XBans: mute / unmutexbans.mute / xbans.unmute
XBans: IP mute / unmutexbans.muteip / xbans.unmuteip
XBans: warn / remove a warnxbans.warn / xbans.unwarn
XBans: resolve or delete a reportxbans.unreport
XBans: jail / unjailxbans.jail / xbans.unjail
XBans: watchlistxbans.watchlist
XBans: appealsxbans.command.appeals
XAuctionHouse: cancel a listingah.admin.remove or ah.admin
XAuctionHouse: clear expired, ban, unbanah.admin
XLogin: reset a password, disable 2FA, delete an account, invalidate a sessionxlogin.admin
XShop: add, edit, move or delete a product; create or edit a shop; change prices; restore a versionxshop.admin.edit or xshop.admin
XShop: write or change a product's console commands, or restore a version that brings commands backxshop.admin, with xcore.dashboard.config and xcore.dashboard.config.save
XShop: delete a shop, save the configurationxshop.admin
XShop: set a stock, restock, reset a pricexshop.admin.stock or xshop.admin
XShop: start or stop an event, give a boosterxshop.admin.events or xshop.admin
XShop: run the auditxshop.admin.audit or xshop.admin

So a moderator given xcore.dashboard and xcore.dashboard.xbans works on the XBans pages with the XBans permissions they already have. With LuckPerms, xcore.dashboard.* opens every page but grants no xbans.* permission.

Reading takes the screen's permission

A page that shows what not every member of staff may see also needs the permission of the matching screen in game. A reader without it does not get the page at all. What a plugin shows about one player also needs xcore.dashboard.players.

PagePermission
XBans: bans, IP bans, mutes, IP mutes, warns, reports, jailsxbans.sanctions
XBans: watchlistxbans.watchlist
XBans: appealsxbans.command.appeals
XBans: audit log, classifierxbans.admin
XBans on a player's profile: profile / history / alts / notesxbans.profil / xbans.history / xbans.command.alts / xbans.note, with xcore.dashboard.players
XBans: the list of playersxbans.players and xcore.dashboard.players
XLogin: players (accounts), sessionsxlogin.admin
XLogin on a player's profilexlogin.admin and xcore.dashboard.players
XAuctionHouse on a player's profileah.admin and xcore.dashboard.players
XShop: transactions and their exportxshop.admin.logs or xshop.admin
XShop: auditxshop.admin.audit or xshop.admin
XShop: history of the shop filesxshop.admin.edit or xshop.admin
XShop on a player's profilexshop.admin.logs or xshop.admin, and xcore.dashboard.players

When a change applies

Permissions are read when the player asks for the link, which they do online, and saved with the session. They are read again when the player joins and every minute while they are on this server, and a change applies at the next request. Away from it, the session goes on its last reading for offline-trust-hours (2 by default, 168 at most), then closes, and its owner gets a new link in game with /xcore dashboard; 0 keeps it open only while they are on this server. A rank removed in the meantime therefore applies within that time at most.

To close someone's sessions at once, run /xcore dashboard revoke <player>. XBans closes the sessions of a player it bans, except for a shadow ban, which that would give away.

Deliveries

Anything a plugin owes a player but cannot hand over on the spot: a reward with a full inventory, a payment made while they were offline. It is stored and given on their next join, oldest first.

delivery:
  on-join: true          # hand everything over when the player joins
  per-join-limit: 20     # so a long backlog does not slow a login down

Money always goes through. An item is only marked as taken once it is really in the inventory, so a full inventory postpones it instead of losing it.

The message a player sees comes from the delivery-received key of your language file.

Discord

Every plugin built on XCore that posts to Discord goes through one queue. A webhook that answers "too many requests" is left alone for as long as Discord asks, and the message is sent afterwards rather than dropped.

integrations:
  discord:
    username: "XCore"    # name messages are posted under
    avatar-url: ""

Only the identity is shared. Each plugin keeps its own webhook address, its own events and its own wording in its own config.