Overview
#Crates are built into SimpleSMPCore (crates module). No crates plugin is needed. The package places five crate blocks at spawn:
| Crate | File | Key | How it opens |
|---|---|---|---|
| Common Crate | crates/common.yml | common_key | Random reward by rarity |
| Amethyst Crate | crates/amethyst.yml | amethyst_key | The player chooses one reward (amethyst tools) |
| Armor Crate | crates/set.yml | set_key | Random enchanted armor sets |
| Spawner Crate | crates/spawner.yml | spawner_key | Random spawners |
| Cosmetic Crate | crates/cosmetic.yml | cosmetic_key | Random cosmetics (trails, tags, hats, name colours) |
The shown name of the armor crate comes from config.yml → branding.armor-crate. The Amethyst, Spawner and Cosmetic crates belong to their modules: while amethyst-tools, spawners or cosmetics is off, that crate and its hologram are hidden.
Using a crate
#- Right click a crate block with a key to open it, left click to preview the rewards (
settings.clicks.reverseswaps them). - Players without the needed key are pushed back (
settings.knockback). /crate keysshows your virtual and physical keys,/crate preview <crate>the rewards,/crate milestones <crate>the milestones.- Rare rewards are announced in chat and can launch a firework.
Files
#All files are in plugins/SimpleSMPCore/modules/default/crates/:
| File | What it holds |
|---|---|
config.yml | Module settings: keys, clicks, knockback, history, holograms, animation defaults, key-all, scheduled keys, block protection. |
crates/<crate>.yml | One crate: type, mode, item, animation, costs, preview, hologram, effect, pity, milestones, rewards. Every option is explained in comments. |
keys/<key>.yml | One key: name, item, virtual (true = balance only, false = a signed item), stackable, withdrawable, depositable, hand-required. |
rarities.yml | Rarity tiers and their weights. |
menus/ | Preview, choose, confirm, costs, amount, results and milestones menus. |
/crate editor changes the same files in game.
Crate options
#| Option | Values | Description |
|---|---|---|
type | BLOCK, VIRTUAL | A placed block, or opened from a menu or command only. |
mode | RANDOM, CHOOSE | Random reward, or the player picks one. |
roll | RARITY, WEIGHT | First roll a rarity, then a reward in it; or roll directly by reward weight. |
animation.type | ROLL, SPIN, WORLD, INSTANT | Sliding conveyor, spinning reel, item above the crate, or no animation. Default duration 5s. |
mass | enabled, max | Open several at once. The module default is up to 10 (settings.defaults.mass-max), but the five shipped crates set mass: enabled: false. |
costs | keys, money, XP levels, permission | What one opening costs. Several cost options can be offered. |
preview | rows, slots, lore | The preview menu. hide-unavailable hides rewards the player cannot win. |
hologram | lines, offset, visibility | Text above the crate block. |
effect | HELIX, RING, SPIRAL, SPHERE, BEACON, TORNADO | Particles around the block. |
item-open | enabled, consume, keys | Open the crate by right clicking its crate item or a key anywhere. |
post-open-commands | list | Commands after every opening (%player%, %crate%). |
Rewards
#Each reward has a weight, a rarity, the items (stored as SNBT, so names, lore, enchantments and all components are kept) and optional commands. Rewards can have per-player and global limits with cooldowns and a reset (NEVER, DAILY, WEEKLY, MONTHLY), required permissions, and skip-if-owned (for example a cosmetic the player already has).
Rarities
#rarities.yml defines the tiers from common to rare. Defaults: Common 60, Uncommon 25, Rare 10, Epic 4, Legendary 1 and Impossible 0.1 (the package file also has rare_cc 8.9, epic_cc 5 and mythic 5 for some crates). Each tier has a colour (animation panes and fireworks), and can broadcast, launch a firework and play a sound.
Pity (luck protection)
#Pity is off unless a crate file has a pity: section with enabled: true. None of the five shipped crates has one; add it yourself, for example:
pity:
enabled: true
guarantee-after: 30
min-rarity: epic
reset-on-natural-hit: true
After 30 openings without an Epic or better reward, the next one is guaranteed to be at least Epic. A natural hit resets the counter. The preview shows the pity line. A reward with pity-target: true also counts as a hit.
Milestones
#A crate can reward the number of openings, for example 25 openings give an Amethyst key. Milestones can repeat. /crate milestones <crate> shows the player's progress. The five shipped crates have no milestones; you can add them in the crate editor or the crate file.
Keys
#Keys are physical (an item) or virtual (stored in the database). Physical keys are signed with a secret in data/crates/secret.key, so a key made by another plugin, a command or an old backup is not accepted (settings.keys.sign: true).
| Command | What it does |
|---|---|
/crate key give <player> <key> [amount] | Give keys (amount defaults to 1; add -s to stay silent). A physical key goes into the inventory of an online player; a virtual key, or any key for an offline player, goes to the balance. |
/crate key giveall <key> [amount] | Give keys to everyone online. |
/crate key take, set, balance | Take, set or show a player's keys. |
/crate withdraw <key> [amount] | Turn virtual keys into signed key items, only for keys with withdrawable: true in keys/<key>.yml. |
/crate deposit [key|all] [amount] | Put genuine key items back into the balance (keys with depositable: true, the default). |
/smpcore give <player> crates:key.common_key <amount> | Same as above through the core give command (console too). |
Where players get keys
#- Hourly key (
hourly-keymodule): one key for every hour online, with a countdown bar. - Voting and the vote party, daily rewards, daily quests, envoys, chat games and rank-ups.
- Key-all (
settings.key-all, off by default): everyone online gets keys on an interval, only while a crate block is placed. - Scheduled keys (
settings.scheduled-keys): for example a weekly key for a VIP group (vip-weekly, off by default). - Your store: run
crate key give %player% <key> <amount>from your store's command delivery.
Admin commands
#| Command | What it does |
|---|---|
/crate editor | Create crates, add the item in your hand as a reward, change chances. |
/crate create <id> [name], /crate delete <crate> confirm | Create a crate (with a virtual key <id>_key), or delete it (the file is moved to data/crates/deleted/). |
/crate setblock <crate> | Turn the block you look at into a crate. |
/crate remove, /crate restore, /crate where | Remove the crate block you look at, put a removed one back, list crate blocks. |
/crate givecrate <player> <crate> [amount] | Give a placeable crate item. |
/crate forceopen <crate> [player] [amount] | Open without cost; without a player it opens for you (the console must name one). |
/crate simulate <crate> [count] [player] | Roll a crate many times (10,000 by default) and compare the real odds with the configured ones. |
/crate info <crate>, /crate history | Settings and weights; latest openings. |
/crate validate [--fix] | Find crate blocks whose block is gone (ghost crates); --fix unbinds them. |
/crate reset, /crate resetlimits | Reset a player's progress or the reward limits. |
/crate cleanup | Rebuild holograms and effects. |
/crate import excellentcrates [--apply] | Copy crates, keys, previews, blocks and key balances from ExcellentCrates (dry run without --apply). |
/crate reload | Reload the crates. |
Permissions: simplesmpcore.crates.command.crate (everyone) for opening; simplesmpcore.crates.admin.give, .givecrate, .blocks, .edit, .inspect, .reset, .import, .reload and .forceopen for staff (OP by default).
Crate blocks and protection
#Crate blocks are protected (settings.block-protection). Players without simplesmpcore.crates.admin can never break one. An admin removes a crate block by sneaking and breaking it, then confirming in a menu (remove-mode: MENU, the default; CHAT, COMMAND and NONE are the other modes), or with /crate remove while looking at it. A removed block can be restored for 7 days with /crate restore. On Minecraft 26.x, crate blocks saved in Spawn are found in world_spawn (SimpleSMPCore 1.16.3 and newer).
API for developers
#Other plugins can listen to CratePreOpenEvent (cancellable), CrateOpenEvent and CrateRewardEvent.
Found a mistake or something missing? Open a ticket on Discord.
Report an issue