Skip to content

currencies

One file per currency in currencies/ - economy type, colors, number format, decimals and sales tax.

Every file in currencies/ is one currency sellers can list in. The file name is the currency’s id: money.yml is money, which is what players type in /ah hand 100 money and what %optimalauctions_balance_money% uses. After editing, run /ahadmin reload.

Three currencies ship by default: gems and tokens (OptimalGens) and money (Vault).

Settings:
Display-Name: "Money"
Enabled: true
Type: VAULT
Symbol: ""
Primary-Color: "&a"
Secondary-Color: "&2"
Format: ABBREVIATED
Decimals: true
Tax: 0.0
Key Default Description
Display-Name the file name Shown as {currency}, in the secondary color.
Enabled true false removes the currency as if its file were gone. See Disabling.
Type VAULT Which economy holds the balance. See Types.
Symbol "" Put in front of every formatted amount ($1.5K).
Primary-Color "" Color of amounts ({price}, {unit-price}).
Secondary-Color "" Color of the currency name ({currency}).
Format Number-Format.Default ABBREVIATED (1.5K) or SEPARATED (1,500). The scales and separators come from Number-Format in config.yml.
Decimals true true allows two decimals; false rounds every price, fee and payout down to a whole number.
Tax 0.0 Percentage taken from the seller’s payout on every purchase. 0 up to (not including) 100.
Type Economy Offline sellers
VAULT Any Vault economy (EssentialsX, OptimalEssentials, CMI, …). Paid directly.
PLAYER_POINTS PlayerPoints. Paid directly.
RIVAL_CREDITS RivalCredits. Depends on RivalCredits.
OPTIMALGENS_<currency> A currency from OptimalGens’ own currencies/ folder, e.g. OPTIMALGENS_TOKENS, OPTIMALGENS_GEMS. Queued until they join.
OPTIMALMOBCOINS_MOBCOINS OptimalMobcoins balances. Queued until they join.

OPTIMALGENS_... and OPTIMALMOBCOINS_... balances can only be changed while the player is online, so a sale to an offline seller is stored in the database and paid three seconds after their next join (PAYOUT-RECEIVED).

If the economy plugin behind a currency is missing, the console logs that the currency is unavailable at startup and reload. Nobody can list in it or buy listings priced in it until the plugin is installed.

/ah hand <price> and /ah all <price> without a currency use the first enabled file by file name. With the shipped files that is gems.yml, then money.yml, then tokens.yml.

To make another currency the default, disable or delete the files that sort before it, or rename its file so it sorts first. Renaming changes its id, so existing listings in the old id lose their currency; only rename before you go live.

The Lowest Price and Highest Price sorts group listings by currency first, in the same file name order, and then by price inside each currency. A listing whose currency file is gone sorts last.

Enabled: false (or deleting the file) takes the currency out completely:

  • It can’t be listed in, and it disappears from tab completion.
  • It can’t be the default currency.
  • Existing listings in it stay on the board but refuse purchases with ECONOMY-UNAVAILABLE. Their sellers can still cancel or collect them.
  • Payouts queued in it stay queued until it is enabled again.

At least one currency must stay enabled, or the plugin fails to load.

Create a new file, for example currencies/points.yml:

Settings:
Display-Name: "Points"
Enabled: true
Type: PLAYER_POINTS
Symbol: ""
Primary-Color: "&d"
Secondary-Color: "&5"
Format: SEPARATED
Decimals: false
Tax: 5.0

Run /ahadmin reload. Players can now use /ah hand 500 points, and sellers in it keep 95% of each sale.