Loot chests
Templates and loot tables, placing chests and barrels, the cooldown and its hologram, who can open them, removing them, and what keeps them safe.
Loot chests are chests and barrels in your world that fill themselves from a loot table. A player loots one, it
empties, and after its cooldown it refills on its own, with a hologram above it counting down. Everything is set up
in game with /lootchestsadmin (or the loot chests card of /warzoneadmin).
Two things make it up:
| What it is | |
|---|---|
| Template | An ID, a display name and a loot table. It decides what a refill can put in a chest. |
| Loot chest | A block registered from a template. Each one has its own cooldown, fill mode and state. |
Setting up
Create a template
Open /lootchestsadmin, click Templates, then Create template, and type an ID such as common. IDs
are lowercase (spaces become _) and up to 64 characters. The template screen opens. Display name sets
what the admin screens call it.
Fill its loot table
Click Loot table. This is the ExyliaLib loot editor: An item adds one line, Everything in a chest asks you to click a container and turns every item in it into a line. Edit a line to set its amounts and weight, then save.
Place the chests
Click Place chests and type the cooldown every chest you place now will have (5m, 1h, 0s for none).
Then click each chest or barrel: it becomes a loot chest of this template and fills at once. Keep clicking to
place more; type cancel in chat to stop, and the template screen comes back.
The loot table
Every refill rolls each line on its own. The weight is a percent chance: 100 (or more) always comes up, 25 in
about one refill out of four. The stack size is picked between the line's least and most amount. If no line comes
up, one is picked at random so a chest with a loot table never fills empty. A chest imported with Everything in a
chest gives lines at weight 100, from 1 up to each stack's size.
Loot chest tables hold items only, no commands or money. Copied lines paste into any other ExyliaLib loot editor. A change to the table reaches each chest at its next refill.
Which blocks
A chest, a trapped chest or a barrel (any chest block except an ender chest). Clicking anything else answers "Only a chest or a barrel can become a loot chest."
- Double chests are one loot chest. Register either half: both halves open, refill and are protected together, and a refill fills all 54 slots. The other half cannot be registered a second time.
- What the block held is replaced. A chest fills from its template the moment it is placed.
- Make a double chest before you register it: a chest placed against a loot chest later joins it.
Looting and the cooldown
Anyone can open a loot chest that is ready; no permission is needed. A claim or region plugin that keeps a chest shut still keeps it shut.
- Taking anything is the take. When the player closes the chest, it is emptied, whatever they left behind included, and its cooldown starts. Opening and closing it without taking anything leaves it as it is.
- A player who logs out with the chest open counts as closing it.
- While it refills the chest refuses to open: "This chest refills in 4m 12s ⌚." With
settings.allow-open-on-cooldown, or the bypass permission, it opens anyway, empty. - A cooldown of
0srefills the chest as soon as the player closes it. - The cooldown keeps counting while the server is off. A chest whose cooldown ended meanwhile refills at startup, and one whose chunk is unloaded refills the moment its chunk loads.
- A refill plays a short chime (
sounds.refill) to players within 10 blocks. - Anything a player puts into a loot chest is cleared at its next refill.
- A ready chest that something other than a loot emptied (a command, an edit) is filled again the moment a player opens it, so it never opens empty while its hologram says it is ready.
- Inside a regen zone or a duel room, a paste puts each loot chest back in its own state: empty while it refills, filled again if it is ready.
Fill mode decides where the loot lands: Dispersed (the default for new chests) spreads it over random slots, Stacked packs it from the first slot.
The hologram
| State | Hologram |
|---|---|
| Ready | READY TO LOOT |
| Refilling | Refills in 4m 12s ⌚ |
| Disabled | DISABLED |
It floats settings.hologram-offset-y (1.5) blocks above the chest, is seen from up to 48 blocks away and updates
every second. The three lines are the hologram section of the module's messages file. Turn holograms off with
settings.hologram-enabled: false; a change to either hologram setting reaches chests already standing after a
restart.
Managing chests
| Screen | What it does |
|---|---|
Placed (/lootchestsadmin) | Every loot chest of this server, oldest first, with its block, template, location, cooldown, fill mode and live state. Left-click edits, shift-left-click teleports you on top of it, right-click deletes. |
| Loot chest | Status turns it on or off, Fill mode switches Dispersed and Stacked, Cooldown changes it (from the next take on), Teleport, Delete. |
| Templates | Every template with its loot lines and placed chests. Left-click edits, right-click deletes. |
| Template | Display name, Loot table, Place chests, Delete. |
A disabled chest refuses to open for everyone, bypass included, and its hologram reads DISABLED.
Removing a chest
| How | What happens |
|---|---|
| Delete in the screens | After a confirm, it stops being a loot chest and stays as a plain chest, with whatever it holds right now. |
| Sneak and break it (admins) | After a confirm, its loot is cleared and the block breaks, dropping itself. |
| Delete its template | The template's chests on this server are removed first and stay as plain chests. |
A chest deleted from the screens keeps the loot it holds, and anyone can take it as from any chest. To take a loaded chest out of play, sneak-break it instead.
Nobody else can break a loot chest. A player is told "Loot chests cannot be broken."; an admin who breaks one without sneaking is told to sneak. Explosions, pistons and fire leave it alone, hoppers, droppers and hopper minecarts cannot pull from it or push into it, and a sell wand never sells its contents: the click opens it as a plain open would.
Permissions
| Permission | Default | What it allows |
|---|---|---|
exyliawarzone.lootchests.admin | op | /lootchestsadmin, every loot chest screen, and removing a chest by sneak-breaking it. |
exyliawarzone.lootchests.bypass | op | Opening a chest that is still refilling (it opens empty). |
exyliawarzone.admin includes the admin node but not the bypass. See Permissions.
Networks, statistics and logs
Loot chests belong to the server they were placed on: each server loads and lists only its own. Templates are stored once for every server on the same database; another server picks up a new or edited template when it restarts.
With ExyliaSurvivalCore installed, a take counts the player's lootchests.opened and
lootchests.<template>.opened statistics, which its missions and leaderboards can use. Every placement, removal
and template deletion is written to /exylialib logs.
Settings live in modules/loot-chests/config.yml and messages in lang/<code>/modules/loot-chests/messages.yml.
Every key is on the configuration page, and the Settings
button of /warzoneadmin edits them in game. Chests built with ExyliaSurvivalCore carry over: see
Migrating.
Something missing on this page? Tell us on Discord