English
Economy Bridge
CoreLib connects to your server's economy plugin through one shared configuration: Forge, Strengthen, Gem, and Skills all use it for charges, rewards, and price formulas
Common fields
| Field | Type | Default | Meaning |
|---|---|---|---|
economy.enabled | boolean | true | Enable economy costs or rewards |
economy.provider | string | auto | Economy provider: auto, vault, or excellenteconomy |
economy.currency | string | "" | Currency ID. Leave blank for the Vault default currency; required for ExcellentEconomy |
economy.base_cost | number | — | Base cost |
economy.cost_formula | string | — | Dynamic cost formula, accepting expression variables |
economy.currencies | list | — | Multi-currency list, where supported by the module |
Providers
| Provider ID | Plugin | Notes |
|---|---|---|
vault | Vault | Works with any Vault-compatible economy plugin |
excellenteconomy | ExcellentEconomy | Supports multiple currencies |
Automatic provider selection
When provider is blank or auto, CoreLib picks a provider by these rules:
| Condition | Result |
|---|---|
currency is not blank | Prefers ExcellentEconomy |
currency is blank | Uses Vault with its default currency |
An explicit provider is given | Looked up by ID; fails when unavailable |
ExcellentEconomy always requires a non-blank currency, and auto never infers a default ExcellentEconomy currency — set currency explicitly
Multiple currencies
Some modules can charge several currencies at once:
yaml
economy:
enabled: true
currencies:
- provider: vault
currency: ''
amount: 500
- provider: excellenteconomy
currency: gems
amount: 10That charges 500 of the Vault default currency and 10 ExcellentEconomy gems together
Some modules also accept items as a currency:
yaml
economy:
enabled: true
currencies:
- provider: vault
amount: 1000
- provider: item
item:
type: vanilla
id: EMERALD
amount: 3Whether the multi-currency list and the item currency are honoured depends on the calling module
When the charge happens
The point at which a cost is taken differs per module:
| Module | Charged at | Notes |
|---|---|---|
| EmakiStrengthen | Before the attempt starts | Charged on success and failure alike (configurable) |
| EmakiForge | On confirmation | Taken after the confirm button is clicked |
| EmakiSkills | Before the cast | Consumed once requirements pass; a failed cast is not refunded |
| EmakiGem | On operation confirm | Socket opening, inlay, extraction, and upgrade each configure their own cost |
When configuring, decide explicitly whether a failed attempt still pays, whether cancelling refunds, and whether an insufficient balance blocks the operation (usually it should)
Cost formula forms
yaml
# Linear growth, gentle
cost_formula: '100 + %star% * 50'
# Exponential growth, steep at high levels
cost_formula: '100 * pow(1.5, %star%)'
# Clamped so the cost never goes negative
cost_formula: 'max(10, 100 + %star% * 50 - %bonus%)'Formula variables come from the calling module -- Strengthen, for example, supplies %star% and %level%. Avoid negative prices in production, since players can exploit them to farm money
Economy actions
| Action ID | Parameters |
|---|---|
give_money | required amount; provider=auto; currency="" |
take_money | required amount; provider=auto; currency="" |
set_money | required amount; provider=auto; currency="" |
yaml
actions:
- 'give_money amount=100 provider=vault'
- 'take_money amount=25.5 provider=excellenteconomy currency=gems'Check Vault or ExcellentEconomy loading if economy actions do not work