Skip to content

Economy Warehouse Bridge (mod)

The NeoForge half of the economy audit system. It tells the EconomyWarehouseBridge plugin why money moved when the cause is inside Pixelmon (shop, battle, NPC, Day Care), so the economy dashboards show a real reason instead of "unknown".

What it does

The EconomyWarehouseBridge plugin records every balance change into a MariaDB warehouse. It can see Bukkit plugins, but not Pixelmon. This mod fills that gap:

  • Watches Pixelmon's money events: shop purchases and sales, battle wins and losses, and Pixelmon economy transactions.
  • Tags Pixelmon money moves that fire no event: /givemoney, /transfer between players, NPC "give money" rewards (how NPC trainers pay on this network), Pay Day and Gold Rush battle payouts, and the Day Care fee.
  • Sends each tag to the plugin's local collector over HTTP on the same machine. The plugin matches it to the raw balance change and writes one labelled row.

Source labels include pixelmon_shop_purchase, pixelmon_shop_sell, pixelmon_battle_victory, pixelmon_battle_defeat, and fallback Pixelmon deposit and withdraw events.

Needs the EconomyWarehouseBridge plugin on the same server. Server-side only.

How players use it

Players do not interact with this mod.

Staff guide

Task Command
Reload bridge.json /economywarehousemod reload
Send a test event to the collector /economywarehousemod emit <amount> <source_type> [detail]

Both need op level 2 (console works). emit is for checking the mod-to-plugin path end to end. It writes a real warehouse row, so use an obvious source type such as smoke_test.

Configuration

config/economywarehousebridge/bridge.json, created with defaults on first start. /economywarehousemod reload re-reads it.

Field Default Meaning
collectorUrl http://127.0.0.1:9646/economy-warehouse/ingest The plugin's local collector. Must match the plugin's collector.host and collector.port
sharedSecret change-me Must equal the plugin's collector.shared-secret. Change it on every server
connectTimeoutMs, requestTimeoutMs 2000, 5000 HTTP timeouts
enablePixelmonHooks true Turn the Pixelmon hooks on or off
attributionTtlSeconds 10 How long a tag waits to be matched to a balance change

Data and storage

None. The mod keeps tags in memory for a few seconds. All data is written by the plugin.

Troubleshooting

Symptom Cause Fix
Pixelmon money shows as unattributed in the dashboards Mod not loaded, hooks off, or the collector refused the request Check enablePixelmonHooks, then /economywarehouse status on the plugin side
emit fails Wrong collectorUrl or sharedSecret, or the plugin's collector is disabled Make both sides match. Collector must be enabled in the plugin
Tags arrive but do not match The balance change came later than attributionTtlSeconds Raise the TTL a little

Maintainer notes

  • /transfer produces two XConomy events (a debit and a credit) from one command, so its mixin tags both sides.
  • Pixelmon has no trainer prize money of its own. Trainers that "pay" are NPCs with a GiveMoney interaction result, hooked by MixinGiveMoneyInteractionResult.
  • Pay Day and Gold Rush are paid in PlayerParticipant.endBattle, hooked by MixinPlayerParticipant.
  • PokeDollarsRequirement.takeFrom is the Day Care fee. The balance check next to it moves no money and is not tagged.
  • Pixelmon's /givemoney is tagged separately from XConomy's /money give, which XConomy already labels as an admin command.
  • Mixin line references were checked against Pixelmon 9.3.16.

Building

./gradlew build

Java 21. Output: build/libs/economywarehousebridge-<version>.jar.

Full command, permission and config tables: Reference.