Skip to content
TTS-STUDIO docs Discord

Plugins / CrateForge

Token Economy

Token Economy

CrateForge has a built-in token economy system. Players earn tokens from crate prizes, mob drops, or admin commands, then spend them in the /cf shop to buy crate keys.


What Are Tokens?

Tokens are a custom currency system built into CrateForge, stored per-player in the SQLite database. Unlike Vault money, tokens are entirely internal to CrateForge.

Key features: - Multiple token types (e.g., premium, vote, event) - Players can view their balance with /cf balance - Players spend tokens in /cf shop to purchase keys - Admins give tokens with /cf givetoken


Token Types

Token types are defined in config.yml and referenced by keys and crate prizes:

# config.yml — token type definitions
tokens:
  types:
    - id: premium         # Internal ID used in commands and configs
      display-name: "<light_purple>Premium Token"
      material: AMETHYST_SHARD  # Item representation
    - id: vote
      display-name: "<aqua>Vote Token"
      material: PRISMARINE_SHARD
    - id: event
      display-name: "<gold>Event Token"
      material: GOLD_NUGGET

Note: You can define as many token types as you need. Each is tracked independently per player.


Token Shop (/cf shop)

The /cf shop command opens a GUI where players can browse and purchase keys using tokens.

Keys appear in the shop when they have a SHOP obtain method defined in their keys/*.yml:

# keys/legendary_key.yml
obtain-methods:
  - type: SHOP
    shop-price: 500
    token-type: premium   # Which token type is used for this key

Shop GUI

The shop displays: - Key name and appearance - Token cost and type required - Current player balance of that token type - / Whether the player can afford it (green = can buy, red = cannot)


Giving Tokens to Players

Admin Command

# Give 100 premium tokens to PlayerName
/cf givetoken PlayerName premium 100

# Give 50 vote tokens
/cf givetoken PlayerName vote 50

# Give 200 event tokens
/cf givetoken PlayerName event 200

Requires permission: crateforge.admin

Via Crate Prize

Tokens can be awarded as crate prizes — see Crate Format:

prizes:
  - id: premium_tokens_50
    display-name: "<light_purple>50 Premium Tokens"
    material: AMETHYST_SHARD
    weight: 15
    rarity: RARE
    rewards:
      - type: TOKEN
        token-type: premium
        amount: 50

Via Vote Rewards

If a voting plugin (NuVotifier + VotingPlugin) is installed, you can configure it to run /cf givetoken {player} vote 1 on each vote.


Checking Balances

Player: Check Own Balance

# Check all token balances
/cf balance

# Check specific token type balance
/cf balance premium

Admin: Check Player Balance via API

See the Public API page for programmatic balance checking.


PlaceholderAPI Integration

Token balances are available as placeholders:

%crateforge_tokens_premium%   → Player's premium token balance
%crateforge_tokens_vote%      → Player's vote token balance
%crateforge_tokens_event%     → Player's event token balance

See PlaceholderAPI for full details.


Token Economy Design Tips

Tip: Create separate token types for different sources (votes, events, purchases) to give each meaning and prevent inflation.

Tip: Set shop prices high enough that players need to grind a bit — but not so high that buying keys feels unreachable.

Tip: Use event tokens for limited-time events so that event keys can only be purchased during the event period.


Example Economy Setup

# Three-tier token economy:
# vote tokens → common keys (easy to earn, frequent)
# premium tokens → rare keys (earn from prizes or purchases)
# event tokens → event keys (only during special events)

config.yml:
  tokens:
    types:
      - id: vote
        display-name: "<aqua>Vote Token"
        material: PRISMARINE_SHARD
      - id: premium
        display-name: "<light_purple>Premium Token"
        material: AMETHYST_SHARD
      - id: event
        display-name: "<gold>Event Token"
        material: GOLD_NUGGET

keys/common_key.yml:
  obtain-methods:
    - type: SHOP
      shop-price: 1
      token-type: vote

keys/rare_key.yml:
  obtain-methods:
    - type: SHOP
      shop-price: 50
      token-type: premium

keys/event_key.yml:
  obtain-methods:
    - type: SHOP
      shop-price: 5
      token-type: event

Home | Key Format | PlaceholderAPI | Commands & Permissions