Skip to content

Vault Cost

Lord_Lofi edited this page Apr 19, 2026 · 1 revision

Vault Cost

LofiBox supports an optional per-box economy cost via Vault. When configured, players are charged a set amount from their balance every time they open a box.


Requirements

  • Vault installed
  • Any Vault-compatible economy plugin (EssentialsX, CMI, etc.)

If Vault is absent or has no economy provider, cost checks are skipped and a vault-unavailable message is shown instead.


Configuring a Cost

Add open-cost to any box YAML file:

# plugins/LofiBox/boxes/mythic.yml
name: "<gradient:#a78bfa:#6366f1>Mythic Crate</gradient>"

open-cost: 500.0    # Charges $500 per open

item:
  material: CHEST
  name: "<gradient:#a78bfa:#6366f1>✦ Mythic Crate ✦</gradient>"
  lore:
    - ""
    - "<gray>Costs <gold>$500</gold> to open!"

Set to 0 or omit entirely to disable the cost for that box.


Combining with a Key

Both required-key and open-cost can be active on the same box. The cost is checked before the key, and both are consumed only after all checks pass and the box item is deducted.

required-key: golden
open-cost: 250.0

Admin Bypass

Players with the lofibox.admin permission are never charged and never need a key.


Messages

Edit plugins/LofiBox/messages.yml:

vault-unavailable: "<prefix><red>Economy is not available on this server."
vault-insufficient-funds: "<prefix><red>You need <white>{cost}<red> to open this box. <dark_gray>(balance: {balance})"
vault-charged: "<prefix><gray>You were charged <white>{cost}<gray>."

Placeholders:

Placeholder Description
{cost} Formatted open cost (e.g. $500.00)
{balance} Player's current formatted balance

Clone this wiki locally