TreasureSpawn
Random treasure chests appear around your players as they explore — with tiers, custom loot tables, holograms and deadly mimic traps. Turn walking around into a constant treasure hunt.
A treasure hunt that runs itself
Installation
Get TreasureSpawn running in a minute — it needs no other plugin.
Steps
- Drop TreasureSpawn.jar into your server's plugins/ folder.
- Restart the server (Java 21 required for 1.21+).
- (Optional) Install WorldGuard, DecentHolograms, MMOItems or Vault for the extra features.
- Edit
config.yml/loot.ymlor use/tsadmin, then/ts reload.
data.db) with no setup, or MySQL for networks. Language files are generated on first start in lang/.How chests spawn
Every player has their own timer. When it expires and they are out exploring, a random chest appears near them — no commands, nothing to click. Players standing still are skipped, so the treasure goes to whoever is actually playing.
| Setting | What it does |
|---|---|
enabled-worlds | Which worlds chests can spawn in. |
spawn-cooldown | How long each player waits between chests, as a random range (e.g. 300-900). It is per player, not shared. |
min/max-distance | How far from the player the chest appears (in blocks). |
height-mode | surface, underground or any, within min-y / max-y. |
max-chests-per-world | Anti-lag cap on simultaneous chests. |
despawn-time | Seconds before an unclaimed chest disappears. |
cooldown-reductions | Give a permission to cut a player's personal cooldown by a % (for VIPs). |
spawning.check-interval-seconds | How often the plugin checks who is due for a chest. It does not hand out more — it only makes them arrive sooner once a player's own cooldown ends. |
spawning.max-per-check | How many chests may appear in one check, server-wide. A brake for the first minute after a restart, when nobody is on cooldown. 0 = no limit. |
spawning.require-activity | A player must have moved within the last activity-seconds to be included. This is what stops parked alt accounts collecting chests overnight. |
/ts spawn. The permission treasurespawn.bypass.cooldown ignores the wait entirely.cooldown-reductions and they genuinely get twice the chests — which is what makes it worth selling with a rank.Chest tiers & loot
Each chest rolls a tier by weight, then fills itself from that tier's loot table. Add as many tiers and tables as you want.
| Tier | Chance | Block | Rolls |
|---|---|---|---|
| • Common | 70 | BARREL | 2–4 |
| • Rare | 20 | CHEST | 3–5 |
| • Legendary | 3 | PURPLE_SHULKER_BOX | 4–7 |
| • Mythic | 1 | YELLOW_SHULKER_BOX | 5–10 |
Chances are weights — they don't need to add up to 100. The block can be any container (barrel, chest, shulker box…), and the title supports & colors.
Loot tables (loot.yml)
Each item has a drop chance and an amount range. Vanilla items and MMOItems are supported.
# loot.yml — one table per tier
raro:
items:
- material: DIAMOND
amount: "1-3"
chance: 25.0
- material: GOLD_INGOT
amount: "2-6"
chance: 60.0
- mmoitem: "SWORD:CUTLASS" # needs MMOItems
chance: 5.0/ts give <tier> [player]. Everything (tiers, blocks, rolls, tables) is editable in config.yml / loot.yml or via /tsadmin.5-10 from a table of 6 lines gives 6 at most.Mimic traps
A configurable % of chests are mimics — they punish the player who opens them. Every effect has its own enabled and chance, so you mix exactly the ones you want. Or make some LUCKY, rewarding instead of punishing.
| Effect | What it does |
|---|---|
| Scream + launch | Ghast scream and the player is thrown into the air. |
| Potion effects | Blindness, poison… (your list, each with duration & level). |
| Creepers / mobs | Spawn instantly-exploding creepers or an ambush of vanilla mobs. |
| Lightning / explosion / ignite | Cosmetic or real. Explosions still respect WorldGuard regions. |
| Cage / teleport | Trap the player in cobweb/blocks briefly, or teleport them nearby (safe spot). |
| Money penalty | Take money via Vault. |
| Fake loot / commands | Open a chest full of junk (troll), or run any console commands. |
| LUCKY mimic | Skips all traps and rewards the player from a loot table instead. |
Protection, holograms & hooks
Keep chests fair and good-looking, and let them respect your existing plugins.
| Feature | What it does |
|---|---|
| Private chests | enable-protection: only the player who triggered the chest can loot it. |
| Timed release | protection-duration: seconds a chest stays reserved for the player it appeared for. After that, anyone walking past can open it. 0 = theirs for as long as it lasts. |
| No breaking / trash-canning | Stop players from breaking chests or dumping items inside. |
| WorldGuard | Don't spawn where a player can't build, a strict "no regions at all" mode, and a per-region treasurespawn flag. |
| Holograms | A floating label above each chest (DecentHolograms), fully formatted, showing the tier. |
| Spawn effects | Configurable sound + particles when a chest appears. |
Commands
Base command /treasurespawn — aliases /ts, /treasure, /randomchest.
| Command | What it does |
|---|---|
/ts spawn | Force-spawn a random chest near you (admin) |
/ts give <tier> [player] | Give / place a chest of a tier |
/ts reload | Reload the config & languages |
/ts ver | Plugin version & author |
/tsadmin | Open the admin GUI |
Permissions
Grant these with LuckPerms or any permissions plugin.
| Permission | What it does | Default |
|---|---|---|
| treasurespawn.spawn | Chests can spawn near this player. Revoke it and they receive none. | true |
| treasurespawn.admin | Admin commands & GUI | op |
| treasurespawn.bypass.cooldown | Ask for a chest by hand without waiting for the cooldown. It does not hand out extra chests on the automatic cycle. | false |
| treasurespawn.cooldown.<name> | A % cooldown reduction you define in config (for VIPs) | — |
Configuration
One clean, commented config.yml plus a loot.yml for your loot tables. Add as many tiers and tables as you like.
| Section | What it controls |
|---|---|
language · database | Language and SQLite/MySQL cooldown storage |
spawn settings | Worlds, cooldown, distance, height mode, Y limits, max chests, despawn |
cooldown-reductions | Per-permission % cooldown cuts for VIPs |
chest-types | Your tiers: chance, loot table, block, rolls, title |
protection & WorldGuard | Private chests, no breaking/placing, region rules |
spawn-effects · holograms | Sound + particles on spawn, floating labels |
mimic | Trap chance and every trap effect |
loot.yml | The loot tables referenced by each tier |
config.yml in detail
Every setting in plugins/TreasureSpawn/config.yml. Keys stay in English (that's how the plugin reads them); the comments follow your language.
Language & database
language: en # en | es | fr | zh
database:
type: sqlite # sqlite (no setup) or mysql (networks)
mysql:
host / database / username / password # MySQL connection detailsSpawn rules
enabled-worlds: [ world ] # worlds chests spawn in
spawn-cooldown: 300-900 # each player's own wait, in seconds (range)
min-distance: 10 # min distance from player
max-distance: 30 # max distance from player
height-mode: surface # surface | underground | any
min-y: 60 max-y: 320 # Y height limits
max-chests-per-world: 50 # anti-lag cap
despawn-time: 600 # seconds until an unclaimed chest vanishes
cooldown-reductions:
treasurespawn.cooldown.vip: 25 # % cooldown cut for that permission (VIP)
treasurespawn.cooldown.vip2: 50
treasurespawn.cooldown.mvp: 75
spawning:
check-interval-seconds: 20 # how often the plugin checks who is due
max-per-check: 5 # chests per check, server-wide (0 = no limit)
require-activity: true # a parked account receives nothing
activity-seconds: 120 # how recently they must have movedA chest tier (all tiers share this shape)
chest-types:
rare:
chance: 20.0 # weight (need not total 100)
loot-table: raro # table in loot.yml
inventory-title: &6Rare Chest # title (supports & colors)
material: CHEST # block: BARREL, CHEST, SHULKER_BOX...
rolls: 3-5 # how many items drop (range)Protection & WorldGuard
enable-protection: true # only the finder can open it
protection-duration: 0 # seconds it stays reserved (0 = always theirs)
prevent-chest-breaking: false # stop players breaking the chest
prevent-item-placement: true # stop trash-canning items into it
respect-worldguard: true # do not spawn where players cannot build
worldguard-block-all-regions: false # strict: never inside any regionSpawn effects & holograms
spawn-effects:
enabled: true # effects when a chest spawns
sound: ENTITY_PLAYER_LEVELUP # sound
particle: TOTEM_OF_UNDYING # particles
holograms:
enabled: true # requires DecentHolograms
height: 1.5 # height above the chest
format: [ &7Click to open, {chest_type} ] # hologram linesMimic traps
mimic.chance: 5.0 # % chance a chest is a trap
effects: # cada uno con enabled + chance
launch-player / potion-effects # launch / poison the player
spawn-creepers / spawn-mobs # exploding creepers / ambush
lightning / explosion / ignite # lightning / explosion / fire
cage / teleport # temporary cage / teleport
vault-penalty.amount: 100.0 # money penalty (requires Vault)
fake-loot / run-commands # fake loot / commands ({player})
lucky.reward-loot-table: mitico # lucky mimic: rewards instead/ts reload (or use /tsadmin). Your config.yml is never overwritten on update — new options are added automatically, keeping your settings.Version history
Every release and what changed in it.
- ✨Chests are handed out per player, not one at a time for the whole server. Before, a single chest appeared every 5–15 minutes and went to one player, so on a busy server most people almost never saw on
- ✨AFK protection — a player has to have moved recently to be included, so parked alts collect nothing overnight. Configurable, and can be turned off.
- ✨Chest protection can expire — protection-duration releases an unclaimed chest to anyone after a while. 0 keeps the old behaviour.
- 🔧VIP cooldown reductions are worth buying now — a 50% reduction means twice the chests. The server-wide bottleneck used to eat most of the benefit.
- 🔧No more disk write per chest — chests.yml was rewritten in full, on the main thread, every time a chest appeared or vanished. Batched now.
- 🔧config.yml documents what actually happens, including two options that existed but were written nowhere.
- 🐛Loot could vanish out of your hands — if the despawn timer ran out with the chest open, it was emptied and removed mid-pick. An open chest is now left alone.
- 🐛The "protection time" in the admin GUI did nothing. You could set it and save it, and nothing read it.
- 🐛treasurespawn.spawn was ignored by the automatic spawner — revoking it stopped nothing.
- 🐛treasurespawn.bypass.cooldown no longer floods a world — it exempts from the cooldown when a chest is asked for by hand, which is its purpose.
No notes for this version.
Discussion
Comment and share your experience on each plugin version.
No comments on this version yet — be the first!
No comments on this version yet — be the first!
Player reviews
What server owners think of this plugin.
Buen plugin!