Skip to content
◆ TTS-STUDIO docs Discord

Plugins / CrateForge

Key format

Each key is defined in its own .yml file inside plugins/CrateForge/keys/. Keys are tracked via PersistentDataContainer (PDC) — not lore — making them tamper-proof.

Full example: keys/legendary_key.yml

# keys/legendary_key.yml
# ─────────────────────────────────────────────────
# Unique identifier — used in /cf givekey and referenced by crate's key-id field
id: legendary_key

# Display name shown on the key item — supports MiniMessage
display-name: "<gold><bold>Legendary Key</bold></gold>"

# The item material for the physical key
material: TRIPWIRE_HOOK

# Apply a glowing enchantment effect to the key item
glow: true

# ─────────────────────────────────────────────────
# OBTAIN METHODS — how players can get this key
# ─────────────────────────────────────────────────
obtain-methods:

  # Method 1: Purchase from the /cf shop using tokens
  - type: SHOP
    shop-price: 500          # Token cost
    token-type: premium      # Which token type is used

  # Method 2: Admin give command (/cf givekey)
  - type: COMMAND
    # No additional fields — this is just a flag that the key is giveable

  # Method 3: Vote reward (via NuVotifier / VotingPlugin integration)
  - type: VOTE
    # No additional fields — keys are given automatically on vote

Field reference

Top-Level Fields

Field Type Required Description
id String Yes Unique key identifier; referenced in crates as key-id
display-name String Yes MiniMessage formatted name shown on the item
material String Yes Bukkit material name for the key item
glow Boolean No Apply enchantment glow effect (default: false)
obtain-methods List No Ways players can obtain this key

Obtain method types

SHOP — Key Shop

Players can buy this key from the /cf shop with CrateForge tokens or any other currency.

obtain-methods:
  - type: SHOP
    shop-price: 500       # Price
    token-type: premium   # Token type to use (must be defined in config.yml)

  # or, paid in something else:
  - type: SHOP
    shop-price: 2500
    shop-currency: playerpoints
Field Required Description
shop-price Yes Price (whole number for tokens)
shop-currency No TOKENS (default), vault, playerpoints, xp-levels, xp-points, tokenmanager or coinsengine:<id>
token-type With TOKENS Which token type to spend (default premium)

COMMAND — Admin Give

Marks that this key can be given by admins via /cf givekey. No additional fields needed.

obtain-methods:
  - type: COMMAND

Note: All keys can be given via /cf givekey regardless of whether COMMAND is listed. This method type is mainly declarative/documentation.

VOTE — Vote Reward

Keys of this type are automatically distributed when players vote (via NuVotifier / VotingPlugin integration).

obtain-methods:
  - type: VOTE

Note: Requires a vote plugin (NuVotifier + VotingPlugin) to be installed for automatic distribution.

Common key materials

Material Appearance Notes
TRIPWIRE_HOOK Hook-shaped Default — looks like a key
NETHER_STAR Star-shaped Great for legendary keys
BLAZE_ROD Rod Glowing feel
NAME_TAG Tag-shaped Simple key look
GOLD_INGOT Gold For premium keys

Tips

Tip: Set glow: true on rare keys to make them visually distinct from common ones in players' inventories.

Tip: Use different materials for different key tiers (e.g., IRON_INGOT for common, GOLD_INGOT for rare, NETHER_STAR for legendary) to make keys immediately recognizable.

Note: Keys are validated by PDC when a player tries to open a crate — changing the key's material after distribution will not invalidate existing keys.

Keep reading