GroupeZ Docs
AddonszAuctionHouseStats

Installing zAuctionHouseStats

How to install zAuctionHouseStats, configure its database and verify that statistics are collected

This guide covers installing the zAuctionHouseStats addon, choosing its storage, and checking that statistics are being collected.

Requirements

Server Requirements

RequirementVersion
Java21 or higher
Minecraft1.21+ (api-version: 1.21)
Server softwarePaper and its forks, Folia (folia-supported: true)

Required Plugins

These plugins are declared in the depend list of plugin.yml: the addon will not load without them.

PluginNotes
zAuctionHouseVersion 4 only. The addon refuses to start with an older zAuctionHouse, or if zAuctionHouse itself is disabled (for example after a database failure on its side).
zMenuProvides the statistics menus. The addon disables itself if zMenu is not working.

Optional Plugins

PluginNotes
PlaceholderAPIDeclared as softdepend. When it is enabled, the zahstats expansion is registered automatically. See Placeholders.

Libraries

The JDBC drivers are declared in the libraries section of plugin.yml, so the server downloads them on the first start. You do not need to install anything else.

LibraryVersion
org.mariadb.jdbc:mariadb-java-client3.5.6
org.xerial:sqlite-jdbc3.46.0.0

zAuctionHouse stats events

The addon collects statistics through events exposed by zAuctionHouse. If your zAuctionHouse build does not expose them yet, the addon stops with an error unless you explicitly allow the degraded logs polling mode (collection.polling.enabled: true). Keep zAuctionHouse up to date to get exact statistics. See Configuration.

Installation Steps

1. Install the Jar

Place zAuctionHouseStats.jar in your server's plugins/ folder, next to zAuctionHouse.jar and zMenu.jar.

2. Start Your Server

Start the server once to generate the default files. With the default settings (SQLite), the addon works immediately.

3. Configure Storage and Timezone

Edit plugins/zAuctionHouseStats/config.yml:

  • choose the storage type (SQLite for a single server, MySQL/MariaDB for a network);
  • set the timezone before any statistics are recorded or imported.

4. Restart Your Server

Some settings are only read at startup: storage-type and database-configuration, collection.*, statistics.timezone, statistics.save-itemstacks, retention.sales-days and language.yml. /zahstats reload does not apply them (it prints a "restart required" warning in the console). Restart the server after changing them.

File Structure

After the first start, zAuctionHouseStats creates the following structure:

plugins/zAuctionHouseStats/
├── language.yml            # Language of the generated files (auto, en, fr, es, it)
├── config.yml              # Main configuration
├── messages.yml            # All addon messages
├── inventories/
│   ├── stats.yml           # Statistics hub (/ah stats)
│   ├── leaderboard.yml     # Leaderboards
│   ├── player-stats.yml    # Player statistics
│   ├── item-prices.yml     # Item price explorer (/zahstats items)
│   └── admin.yml           # Admin status menu
├── patterns/
│   ├── zahstats-back.yml
│   └── zahstats-pagination.yml
└── database.db             # SQLite database (if using SQLite)

Language

language.yml is read before any other file is generated. It selects the language of messages.yml, inventories/ and patterns/.

ValueLanguage
autoDetected from the server locale (default): French-speaking countries give fr, Spanish-speaking countries es, Italy/San Marino/Vatican it, anything else en
enEnglish
frFrench
esSpanish
itItalian

Any other value prints a warning and falls back to English. config.yml is always generated in its default version, whatever the language.

Changing the language later

The language only applies to files that do not exist yet. To switch language, delete messages.yml and the inventories/ and patterns/ folders, then restart the server. /zahstats reload does not change the language.

Storage

zAuctionHouseStats uses its own database connection. It never writes into the zAuctionHouse tables: all its tables use their own prefix.

# SQLITE | MYSQL | MARIADB
storage-type: SQLITE

database-configuration:
  table-prefix: "zahstats_"
  host: 192.168.10.10
  port: 3306
  user: homestead
  password: secret
  database: zauctionhouse
  max-pool-size: 4
  min-idle: 2
  debug: false
KeyDefaultDescription
storage-typeSQLITESQLITE, MYSQL or MARIADB. Any other value prevents the addon from starting.
database-configuration.table-prefixzahstats_Prefix of every table created by the addon. Only letters, digits and _ are allowed.
database-configuration.host192.168.10.10MySQL/MariaDB host.
database-configuration.port3306MySQL/MariaDB port.
database-configuration.userhomesteadDatabase user.
database-configuration.passwordsecretDatabase password.
database-configuration.databasezauctionhouseDatabase name.
database-configuration.max-pool-size4Maximum connections in the pool (MySQL/MariaDB only, minimum 1).
database-configuration.min-idle2Idle connections kept in the pool (MySQL/MariaDB only, minimum 0).
database-configuration.debugfalsePrints every SQL request in the console.

SQLite

With storage-type: SQLITE, the data is stored in plugins/zAuctionHouseStats/database.db. No other setting is needed. SQLite is meant for a single server.

MySQL / MariaDB

Set storage-type to MYSQL or MARIADB and fill in the connection details. You can use the same database as zAuctionHouse: the addon tables are kept apart by their prefix (zahstats_ by default).

With MySQL/MariaDB, the addon always uses a HikariCP connection pool sized by max-pool-size and min-idle.

If the connection or the migrations fail (or do not complete within 60 seconds), the addon disables itself and prints the reason in the console. It never runs in a degraded mode without storage.

Shared database-configuration.yml

If a database-configuration.yml file exists at the root of the server (the same file used by zAuctionHouse V4 and other GroupeZ plugins), it takes priority over config.yml key by key: each key it defines replaces the one in config.yml, missing keys fall back to config.yml.

The following keys are read from this file, under the database-configuration section:

KeyRead from the shared file
host, port, user, password, database, debugYes
table-prefixNo, always read from the addon config.yml
max-pool-size, min-idleNo, always read from the addon config.yml
storage-typeNo, always read from the addon config.yml

When the file is detected, the console shows:

Using the server-wide database-configuration.yml for database credentials (table-prefix is still read from config.yml).

If the file exists but cannot be read, a warning is printed and the values of config.yml are used instead.

Why the prefix is not shared

database-configuration.yml is shared between several plugins. Reading its prefix would mix the addon tables with those of the other plugins, so the addon always uses its own table-prefix.

Tables Created

On startup, the addon runs its migrations and creates the following tables (shown with the default zahstats_ prefix):

TableContent
zahstats_salesOne row per sale
zahstats_listingsOne row per listed item
zahstats_player_statsAll-time totals per player and economy
zahstats_player_namesLast known name of each player
zahstats_player_dailyDaily totals per player (DAY / WEEK / MONTH periods)
zahstats_global_dailyDaily server-wide totals per economy
zahstats_global_statsServer-wide all-time statistics
zahstats_import_stateProgress of /zahstats import
zahstats_migrationsMigration registry

The migration registry follows the prefix (<prefix>migrations; with an empty prefix it is zahstats_migrations). It is never the generic migrations table nor the zAuctionHouse one, so the addon can safely share a database with zAuctionHouse. After the migrations, the addon checks that all tables exist; if one is missing while the registry marks it as created, the addon stops and tells you to drop that registry table (or restore the missing tables) and restart.

Changing the table prefix

Changing table-prefix on an existing database creates a new, empty set of tables under the new prefix. The old tables are neither renamed nor migrated.

Timezone

Statistics for the DAY, WEEK and MONTH periods are grouped by day. The timezone used to cut those days is set in config.yml:

statistics:
  # Empty = server timezone. Example: "Europe/Paris".
  timezone: ""
ValueBehavior
"" (default)Uses the timezone of the server
A zone ID, e.g. Europe/ParisUses this timezone
An invalid zone IDThe addon refuses to start

Set it once, before any data

Set the timezone before the first start with real traffic and before running any /zahstats import: imported history is also grouped by day with this timezone. Never change it afterwards: days already stored are not recalculated. The change also requires a restart (/zahstats reload only prints a warning).

The same timezone is used to display dates in the date placeholders (placeholders.date-format).

Multi-Server

When several servers share one auction house (see the zAuctionHouse Redis addon):

  • use MYSQL or MARIADB and point every server to the same database with the same table-prefix. Counters are written as atomic increments, so several servers can write at the same time;
  • do not use SQLite: each server would only see its own statistics. If the zAuctionHouseRedis addon is installed while the addon uses SQLite, a warning is printed at startup;
  • each sale keeps the server name configured in zAuctionHouse;
  • use the same statistics.timezone on every server;
  • if you have to use the degraded logs polling mode (collection.mode: LOGS_POLLING), enable collection.polling.enabled on one server only. Servers with LOGS_POLLING and polling disabled collect nothing and print a warning.

Verify Installation

Console

A successful start prints lines similar to:

Storage ready (SQLITE, prefix 'zahstats_').
Statistics collection: zAuctionHouse stats events.
zMenu inventories loaded (language: en).
PlaceholderAPI expansion 'zahstats' registered.
zAuctionHouseStats 2.0.0 enabled.

The PlaceholderAPI line only appears when PlaceholderAPI is installed.

In Game

CommandWhat to check
/zahstats or /zahstats help (alias /zahs)Lists the subcommands you have access to
/ah statsOpens the statistics hub (subcommand added to the zAuctionHouse command by the addon)
/zahstats top <metric>Shows a leaderboard in chat
/zahstats player [name]Shows the statistics of a player
/ah priceShows the price statistics of the item in your hand

All permissions default to operators. The admin menu (admin.yml, opened from the hub with zauctionhouse.stats.admin) shows the storage type, the collection mode and the state of the write queue and caches.

Statistics are written to the database every few seconds (flush.interval-seconds, 2 by default, or earlier once flush.max-pending events are waiting). On the server where the sale happens, player statistics already in cache and the global statistics are updated immediately. Leaderboards are recalculated when their cache expires (caches.leaderboard-ttl-seconds, 60 by default) and item prices every hour (caches.material-price-ttl-seconds, 3600), so a new sale can take that long to appear there. Use /zahstats clearcache to force an immediate refresh of the caches.

See Commands & Permissions for the full reference.

Upgrading from V1

zAuctionHouseStats V2 only works with zAuctionHouse V4. Your V1 history (zah_* tables) and the zAuctionHouse V4 logs can be imported into the new tables with /zahstats import v1 and /zahstats import v4logs: without confirm the command only shows a preview (estimated rows and duration), /zahstats import <v1|v4logs> confirm starts the import. V1 placeholders keep working through compatibility aliases (placeholders.enable-v1-aliases).

Set the timezone before importing, then follow the Migration guide.

Next Steps

On this page

GroupeZ MCP

Documentation in your AI

MCP lets your AI search GroupeZ documentation and read current examples to help you configure your plugins.

Read-only · No documentation API key needed

1. Copy the server URL

Transport: HTTP (Streamable HTTP). Authentication: none. Your tool uses its own model and subscription limits.

  1. Open Plugins in ChatGPT on the web, then + → Add custom MCP server.
  2. Name it ‘GroupeZ Documentation’, paste the URL above and choose ‘No authentication’. Create and install the plugin.
  3. In a conversation, type @ and select the plugin before asking. If needed, enable search, get_page and list_pages in its settings.
Official setup guide

3. Ask a question

Use GroupeZ MCP to help me create a zMenu inventory. Search relevant pages, read the examples and cite your sources.
Other clients and troubleshooting

For clients using mcpServers, adapt this example to their format:

{
  "mcpServers": {
    "groupez-docs": {
      "url": ""
    }
  }
}

Available tools are search, get_page and list_pages. Refresh the connector’s tools after updates. If your AI cannot access them, check that the connector is enabled in the conversation and your account allows custom MCP servers. Opening the URL in a browser is not an MCP test.