Keys and buying
Every crate can be opened with keys. A crate with purchasable: true can also be opened by paying money or points.
Two kinds of keys#
- Stored (virtual) keys are a number on the player's profile. They survive death and full inventories.
- Physical keys are real items, tagged with the crate id. Players can trade or store them. A renamed item can never open a crate, and keys cannot be placed as blocks.
Players switch between the two with /mv withdraw <crate> [amount] (stored to item) and /mv deposit (every key item in the inventory back to stored keys).
Giving keys#
/mv givekeys Steve example_crate 5
/mv givekeys Steve example_crate 5 physical
/mv givekeys all example_crate 1
/mv givekeys Steve example_crate 5 -s
- Works for offline players who have joined before. Physical keys for an offline player are handed out the next time they join. Use this in your store's delivery command.
all(or*) gives every online player keys and announces it in chat (keys.broadcast-keyall).physicalgives key items instead of stored keys.-sgives silently./mv takekeysand/mv setkeyschange stored keys.setkeysaccepts 0.
Opening#
- Right-click the crate block while holding its key to open at once (
keys.quick-open). Sneak to open as many as you have keys for, up to the bulk limit. - Right-click the air with a key to preview that crate's rewards (
keys.preview-on-use). - The crate screen has buttons to open 1, 5 or 10. After a multi-open a results screen reveals the rewards one by one, shows the best pull and offers "open again".
/mv open <crate> [amount]opens from the command line.- When a player has both kinds,
keys.use-firstdecides which is spent first. - On a purchasable crate, a key is used before money when the player has enough (
keys.keys-before-buying).
Buying a crate open#
purchasable: true
price: 2500.0
# economy: vault | playerpoints | none (per-crate backend selection)
economy: vault
# currency: optional id that picks a price format from config.yml
# economy.price-format.currencies. Leave empty for the default format.
currency: ""
If the chosen economy is not installed, the crate cannot be bought. Prices are shown in menus, holograms and placeholders using economy.price-format in config.yml (decimals, thousands separator, compact form such as 2.5k, and a format per provider or per currency).
A custom key item#
Set the default key look in config.yml under keys.default-item. Give one crate its own key with a key: section in its file (material, name, lore, glow, custom-model-data), or hold any item and set it as the key in the admin panel crate settings. {crate} in the key name is replaced with the crate name.