Key Format
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 — Token Shop
Players can buy this key from the /cf shop using tokens.
obtain-methods:
- type: SHOP
shop-price: 500 # Amount of tokens required
token-type: premium # Token type to use (must be defined in config.yml)
| Field | Required | Description |
|---|---|---|
shop-price |
Yes | Cost in tokens |
token-type |
Yes | Which token type to spend |
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 givekeyregardless of whetherCOMMANDis 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: trueon 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.
Navigation
Home | Crate Format | Token Economy | Commands & Permissions