Skip to main content

Creating Treasure Chests

webapp_banner.jpg

Treasure Chests are a feature allows admins to make chests that can either drop loot or spawn a mimic (hostile) boss.

Values

isEnabled

Sets if a treasure chest is enabled.

KeyValuesDefault
isEnabledBooleanfalse

Disabled chests are skipped entirely: they are not placed in the world, and they are not offered to (or accepted by) /em place treasureChest. Set this to true before trying to place the chest.

Example
isEnabled: true

chestType

Sets the type of chest material.

KeyValuesDefault
chestTypeMaterialCHEST
Example
chestType: CHEST

This needs to be a valid chest material such as CHEST or BARREL.

create_chest_material.jpg


facing

Sets the facing direction of the chest.

KeyValuesDefault
facingSpecial [1]NORTH
Example
facing: NORTH

This sets the direction the chest faces. Valid values are NORTH, SOUTH, EAST, or WEST.

Special [1]

Expand Table
Facing
NORTH
SOUTH
WEST
EAST

dropStyle

Sets if the chest is meant to be dropped for one player or multiple players.

SINGLE chests are consumed by the first player who opens them: the block is replaced with air, a restockTime is written, and the block reappears once restockTimer minutes have passed. There is no per-player tracking, so whoever gets there first takes the whole chest.

GROUP chests are never removed from the world. Instead each player who opens one is put on their own cooldown, so every player can loot the chest once per restock period. Those cooldowns are stored in the restockTimers field, which the plugin writes to the file for you.

KeyValuesDefault
dropStyleSINGLE / GROUPSINGLE
Example
dropStyle: SINGLE

lootList

Lists the loot that the treasure chest should drop when opened.

KeyValuesDefault
lootListEM Loot Tablenone
Example
lootList:
- filename=elite_scrap_tiny.yml:chance=0.90
- filename=magmaguys_toothpick.yml:chance=1.0

If no entry in the list passes its chance roll, the player is sent the treasureChestNoDropMessage from config.yml so the chest does not just silently give nothing. The cooldown is still consumed.


mimicChance

Sets the chance of spawning a hostile boss instead of dropping loot.

KeyValuesDefault
mimicChanceDouble0

The roll happens per interaction, before any loot is generated. When the roll succeeds, the mimic spawns instead of the loot dropping — the chest never does both. The chest's cooldown is consumed either way.

Example
mimicChance: 0.5

mimicCustomBossesList

Specifies the list of hostile bosses available for spawning. A single boss will be randomly selected from this list for spawning.

The list also supports a weight system that you can implement to ensure some bosses are picked more often that the others.

KeyValuesDefault
mimicCustomBossesListString Listnone
Example
mimicCustomBossesList:
- my_cool_mimic_boss.yml
- weak_mimic_boss.yml

If you wish to assign weights to the bosses, the list should be formatted as follows:

mimicCustomBossesList:
- my_cool_mimic_boss.yml:60
- weak_mimic_boss.yml:40

In this configuration, my_cool_mimic_boss.yml is more likely to be chosen for spawning than weak_mimic_boss.yml.

An entry with no weight suffix, and an entry whose weight cannot be read as a number, both fall back to a weight of 1.

What level does the mimic spawn at?

That depends on the boss file you point at, not on the chest:

Mimic boss's levelLevel it spawns at
A fixed numberchestTier × 10, plus a random 0-10
dynamic (-1) inside a dynamic dungeonThe dungeon's selected level, ±1
dynamic (-1) anywhere elseThe opening player's natural spawn level, ±1

If the boss file named in the list cannot be found, no mimic spawns and a warning is logged — the player gets nothing, not the loot.


restockTimer

Sets the time, in minutes, before the chest refills with loot.

KeyValuesDefault
restockTimerInteger0

For SINGLE chests this is how long the block stays gone before it is put back. For GROUP chests it is how long each individual player has to wait before they can loot the chest again.

Leaving this at the default of 0 means there is effectively no cooldown at all, so the chest can be farmed repeatedly. Set a real value on any chest that drops something worth having.

Example
restockTimer: 30

effects

Note: This setting currently does nothing. The key is still read from the configuration file without erroring, and it is still written out with the other defaults, but nothing in the plugin consumes the parsed value, so no particles are ever spawned by a treasure chest.

If you want particles around a chest, spawn them from another source for now.

KeyValuesDefault
effectsString Listnone

locations

Sets the locations where the treasure chest will spawn.

Locations can be added using /em place treasureChest <treasurechestfilename.yml> while standing at the desired location. This command automatically adds your current position to the chest's locations list and updates the configuration file.

KeyValuesDefault
locationsString Listnone

Each entry uses the format worldName,x,y,z,yaw,pitch. The shorter worldName,x,y,z form is also accepted, in which case yaw and pitch are treated as 0.

Entries may carry a :unixTimestamp suffix, which is how EliteMobs stores the restock time of that individual chest placement. The plugin writes this suffix itself when a SINGLE chest is looted — you do not need to add it, and you can delete it to make the chest available immediately.

One file can hold as many locations as you like, and each one becomes its own chest with its own restock timer.

Example
locations:
- my_world,10,50,10,0,0
- my_nether_world,12,58,12,0,0
- my_world,80,64,-30,0,0:1707394380

chestTier

Sets the tier of the chest, which is the baseline for the level of the loot it drops. The baseline level is chestTier * 10.

KeyValuesDefault
chestTierInteger0

How much chestTier actually matters depends on where the chest is and what kind of item is in the loot table:

SituationLevel the loot drops at
Chest opened outside any instancescalable elite items follow the opening player's level, ±1. Everything else uses chestTier * 10.
Chest inside a dynamic dungeonThe dungeon's selected level is used for everything, with scalable elite items getting ±1. chestTier is ignored.
Chest inside any other instancechestTier * 10 for everything.

So on a normal survival world chestTier mostly sets the level of your fixed and limited items, while scalable items track the player who opened the chest. Note that the mimic uses a different formula — see mimicCustomBossesList.

Leaving this at the default of 0 gives a baseline loot level of 0.

Example
chestTier: 3

instanced

Sets if the chest should be instanced (for use in instanced dungeons). All restock timers are disabled when chests are placed in dungeons.

DO NOT SET THIS VALUE MANUALLY.

KeyValuesDefault
instancedBooleanfalse
Example
instanced: true

restockTime

After a chest has been looted, the plugin will write this key to track restock time.

This is only used by the legacy single-chest format, where the chest's position lives in a location key instead of the locations list. As soon as a file has any locations entries, the restock time is written as a :unixTimestamp suffix on the matching locations entry instead and this key is left alone.

DO NOT SET THIS VALUE MANUALLY.

KeyValuesDefault
restockTimeUnix Timestamp0
Example
restockTime: 1707394380

restockTimers

Stores per-player cooldown data for GROUP mode chests. The plugin writes this automatically, and prunes expired entries as it reads them.

Instanced chests do not use this list — inside an instance the per-player cooldown is kept in memory for the lifetime of that instance only.

DO NOT SET THIS VALUE MANUALLY.

KeyValuesDefault
restockTimersString Listnone
Example
restockTimers:
- '1234567890-abcd-efgh-ijkl-123456789012:1707394380'
- '0987654321-zyxw-vutr-sqpo-098765432109:1707395000'

Each entry contains a player UUID and Unix timestamp separated by a colon.


Treasure Chest Config Example
isEnabled: true
chestType: CHEST
facing: NORTH
chestTier: 3
dropStyle: GROUP
lootList:
- filename=elite_scrap_tiny.yml:chance=0.90
- filename=magmaguys_toothpick.yml:chance=0.95
mimicChance: 0.50
mimicCustomBossesList:
- balrog.yml
- killer_rabbit_of_caerbannog.yml
restockTimer: 1
locations:
- world,0.0,-60.0,-14.0,0.0,0.0

Note that every loot entry above uses the filename= prefix. Writing magmaguys_toothpick.yml:chance=0.95 instead would be read as the legacy filename.yml:chance format, and chance=0.95 is not a number, so the entry would log a parse warning on every startup.

create_chest_chest.jpg