8 releases, newest first.
/crates editor, pick up any item from your own inventory and click a crate with it. The crate list draws that crate with the item from then on, instead of the chest (or whatever templates.crate.material is). The crate stores a copy of one item: the item stays on your cursor, so you can click the next crate with it or put it back.{lore} placeholder on the crate template places it wherever you want it.guis/editor-main.yml now declares player-inventory: open, which is what lets you pick an item up while the editor is open. Nothing can be put INTO the menu: clicks on its cells stay cancelled. Existing installs get the new keys on the next boot; the two new lore hint lines only appear in a fresh file.editor-icon:. A value that cannot be read is reported once in the console and the crate is drawn with the default icon; the value is kept until you reset the icon.Crate#getEditorIconClone(), Crate#withEditorIcon(...), Crate.Builder#editorIcon(...).Now requires SnLib 1.28.0 or later (was 1.24.0).
config.yml. holograms.provider is snlib by default, which is built in and needs nothing else. decentholograms and fancyholograms draw them through those plugins instead, and there every viewer sees their own value of a player placeholder such as %sncrates_keys_<crate>%. A provider that is missing, or too old or new to work, falls back to snlib with one console warning. Switching provider takes effect on /crates reload.holograms.enabled is the master switch. height is the distance from the block's top face to the lowest line, and means the same under every provider. update-interval-ticks sets how often placeholders refresh, and lines is the template ({crate} is the display name, {crate-id} the id).hologram: section can replace lines or height for that crate only, or hide its holograms with enabled: false. Keys you leave out follow config.yml, and an editor save keeps the section exactly as you wrote it, placeholders included.Crate#getHologram(), Crate#withHologram(...) and the new com.sn.crates.model.CrateHologram.Existing installs get the new holograms: block in config.yml on the next boot, with holograms switched on. Set holograms.enabled: false to keep crate blocks bare.
/crates and the preview's info and withdraw buttons are all drawn from the crate's physical key item, and SnLib paints a template over a supplied item by appending the template's lore under the lore the item already carries. The result was every player reading the key's redeem instructions above the balance the icon exists to show, with no way for a menu file to remove or move them.{lore} placeholder. Those lines are not gone: write {lore} in a template's lore: and they come back, one lore line per line the key has, exactly where you put it. Nothing shows it by default.
guis/key-balance.yml - the default template and any per-crate templateguis/preview.yml - the info and withdraw templatesguis/preview-compact.yml - the info templateExisting installs get the new behaviour with no file edit; nothing in your menu files is rewritten.
PreviewMenu now seeds {crate} (display name) and {crate-id} into the window title when it opens, the way the key balance menu seeds {player}. From 2.0.0 to 2.3.0 a title: "{crate}" in preview.yml or in a custom preview layout rendered the braces literally. No file changes are needed on an install that already wrote {crate} in a preview title; the shipped preview.yml header documents the two title placeholders.access.mass-open-per-tick (shipped 10) crates settle per server tick: the first chunk in the click, the rest one tick apart, so a large balance never runs every reward command in one tick. Every crate of the batch is still a complete open (roll, one key, delivery), so a batch that stops early - the player leaves, the crate is deleted, the server stops - has spent exactly the keys of the crates it opened; the rest stay in the balance./crates menu stays open through a mass open and repaints as the batch drains. access.mass-open-cooldown-ticks (shipped 10) throttles a held Q; the refusal is silent unless messages.open.mass-cooldown says something.Opened Nx <key>: then one line per distinct reward ({amount}x {reward}, {total} also available), plus a line for the fails when there were any.fail.chance in config.yml, or settings.fail-chance per crate (also from the new Fail Chance button on the crate panel): a percentage of opens that spend the key and win nothing. It is rolled in the same draw as the winner, after the check that something is winnable, so a crate with everything on limit still refuses with the key unspent. The animation lands on fail.item with effects.fail-sound and no particle burst, the strip shows that item at the fail rate, the player gets messages.open.fail, opening.log writes status.failed where the reward's name goes, the open counts and no limit burns. CrateOpenEvent fires for it; CrateRewardEvent does not. The preview's info icon says Fails N% of the time and %sncrates_failchance_<crate>% exposes the number.New keys merge in on boot: access.mass-open-per-tick, access.mass-open-cooldown-ticks, fail.chance, fail.item, effects.fail-sound, and the lang keys under messages.open.*, messages.preview.fail-tag, messages.editor.* and status.failed. The editor-crate.yml layout gained the fail-chance cell h on its fourth row (fffhfrfff); an existing install keeps its own layout, so add the letter there to see the button.
/crates key wipe [crate] [confirm]Deletes the virtual key balances of every player on the server, offline players included. Without a crate id it clears every crate; with one it clears only that crate. Physical key items are untouched - they live in inventories and no balance command reaches them.
It cannot be undone, so it runs in two halves. Without the confirmation word the command only counts: it reports how many balances and how many keys are at stake and quotes back the exact line that would destroy them. Only a second invocation carrying that word deletes anything.
/crates key wipe
> WARNING This deletes 4,120 virtual key(s) across 1,284 balance(s), for EVERY player
> and EVERY crate. It cannot be undone. Run /crates key wipe confirm to go through with it.
/crates key wipe confirm
> Wiped 1,284 virtual key balance(s), for every player and every crate.messages.keys.wipe-confirm-word,
default confirm), so it translates with the rest of the plugin. It is never
tab-completed - having to type it is the safety.sncrates.admin.wipekeys (default op, child of sncrates.admin). Required on top of
sncrates.admin.keys, so the ordinary key commands can be delegated to a junior admin
without handing them the one that empties the key economy.
messages.keys.wipe-confirm-word, wipe-warning, wipe-warning-crate, wiped,
wiped-crate, wipe-nothing, wipe-nothing-crate, wipe-failed. They merge into an
existing lang/messages_en.yml on boot; your edits are kept.
The editor tells you how to get out of a chat prompt. Every prompt now
sends the cancel word and the seconds left underneath it. One language key
(messages.editor.cancel-hint), so it covers every prompt including new ones.
Preview Layout is a click, not a chat prompt. It cycles the layouts listed
under the new editor.preview-layouts in config.yml, skipping any id that no
file in guis/ backs, so a crate can never end up pointing at a preview that
will not open.
Accepted Keys offers physical, virtual and both. PERMISSION is off the
button. It still parses out of a crate file and still opens crates - clicking
the button on such a crate restarts the cycle at physical.
A reward's win commands are listed on its icon, numbered, so you can see
which ones are there. A line is marked in red when it will not run as written:
it is empty, it uses a placeholder that does not exist (only {player},
{amount} and {crate} are filled in), or it uses a %papi% token on a server
with no PlaceholderAPI.
Fixed: opening a crate panel logged Invalid value in config.yml -> 'effects.complete-particle-count': received '40', using default '40' once per
render. Nothing was wrong with the value - the panel was reading a number as
text. It is read as a number now.
Tidier defaults. The five three-state controls no longer share two dyes
between them; each state of each control has its own item. Every "Back" is the
same door and the arrows are only ever page arrows. The menu and message text
says what to write - FLAME, BLOCK_CHEST_OPEN 1 1.2 - instead of naming
types like "a Bukkit particle" or "DateTimeFormatter syntax".
CHAIN was avoided on purpose: it is IRON_CHAIN on 1.21.9 and newer. Every
material shipped here resolves on 1.20.2, 1.21.1 and 1.21.11.
A complete rewrite. SnCrates 2.0.0 was written from zero on SnLib and does everything 1.16.2 did, with the same crates, the same commands and the same key items already in your players' inventories.
Read the "Before you update" section. This is a major version and it is a clean break, not an in-place upgrade: some stored data is deliberately not carried over.
Every table now carries the sncrate_ prefix, so 2.0.0 does not read the rows 1.16.2 wrote. On the
first boot you get empty key balances, statistics, opening history, physical block bindings and
reward filters.
The prefix is not cosmetic. CREATE TABLE IF NOT EXISTS never compares columns, so a table name
this plugin does not exclusively own can bind the schema to another plugin's table and fail every
query for the life of the install.
The one you will notice on the server: every placed crate block loses its binding and becomes an ordinary breakable block. Re-bind them from the editor.
If you ran a pre-release 2.0.0 build on a staging server, this empties those tables too, not only 1.16.2's.
Back up your database and your plugins/SnCrates/ folder before updating. Virtual key balances are
the thing worth restoring by hand if you have a busy server.
config-version is gone and nothing is ever regenerated. New keys merge into your files on boot and
your values, your comments and any extra keys you added survive. You can freeze a section you do
not want touched with a # sn:extensible marker.
Old files are simply not read. There is no importer and no migration path - that is deliberate.
SnCrates 2.0.0 needs SnLib 1.24.0 or later installed. It will not enable without it.
The screen that sets a reward's item, adds a reward or sets a crate's key item no longer has a slot you drag into. Hold the item in your main hand and click the capture cell.
This replaced a hand-built inventory that could not use the library's click protection and leaked real reward items in five separate ways.
mass-open-max now ships as 64 instead of unlimited. -1 and 0 still mean genuinely
unlimited, and the config comment says what that costs you: the open loop runs on the main thread,
so an unbounded mass open is a server freeze proportional to the number of keys.
Rather than running with per-player limits unenforced, an open is refused with a new
messages.open.data-loading line and a reload of the slice is attempted.
/crates key take and /crates key set now refuse on a crate that accepts no virtual keys,
instead of reporting success and doing nothing. New line: messages.keys.no-virtual-balance.give.[amount] stays optional for give, giveall and take, and required for set.animations.csgo.strip-size and animations.wheel.strip-size are capped at 256.cancel already did.blocks.bind-armed / blocks.unbind-armed now say "click ... either button", because either
button really does consume the armed gesture.CrateOpenEvent fires immediately after the session is registered rather than just
before. Still after the key is consumed and before the reward is delivered, so the documented
contract is unchanged.api-events.enabled, defaults.reward-weight.messages.general.reload-summary and reload-failed.These are the things a rewrite is most likely to break, so they were held constant on purpose.
sncrates:crate_id tag, so keys already in
players' inventories are recognised.%sncrates_total_opens%, %sncrates_keys_<crateId>%,
%sncrates_opens_<crateId>%, %sncrates_chance_<crateId>_<rewardId>%./crates, aliases crate and snc. A bare /crates still opens your own key
balance.CrateOpenEvent and CrateRewardEvent keep their signatures.Rebuilt as a SnLib consumer: configuration, language, colour, menus, item building, database access, the command tree and PlaceholderAPI all run on the library instead of on hand-rolled code. The plugin no longer bundles a menu library or a YAML library, which removes an entire class of "another plugin shipped a different version" crashes.
Supports Paper 1.20.x and 1.21.x on Java 21.