Random treasure for Minecraft · 1.21+

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.

1.1Version
1.21+Minecraft
NoneRequired deps
ES·EN·FR·ZHLanguages
📍
Random spawnsChests appear near players
🪙
TiersCommon → Mythic
🎁
Custom lootPer-item drop chances
👹
Mimic trapsSome chests bite back
HologramsFloating labels

A treasure hunt that runs itself

📍
Automatic random chestsChests spawn near players on a configurable timer, at a min–max distance. No player command needed — just explore.
🪙
Chest tiersCommon, Rare, Legendary, Mythic (add your own): each with its own chance, loot table, block, roll count and title.
🎁
Custom loot tablesPer-item drop chances, amount ranges, and MMOItems support for RPG servers.
👹
Mimic trapsA % of chests are traps: scream, launch, poison, explode, cage, teleport, money penalty… or a LUCKY mimic that rewards.
HologramsA floating, formatted label above each chest showing its tier (via DecentHolograms).
🛡️
Protection & WorldGuardPrivate chests only the finder can loot, no breaking or trash-canning, and full WorldGuard awareness.
🎚️
Smart spawn controlWorlds, surface/underground modes, Y limits, max chests per world, despawn timer and VIP cooldown cuts.
💾
SQLite or MySQLCooldowns persist across relogs and restarts. Zero setup with SQLite, or MySQL for networks.
🌍
4 languagesEnglish, Spanish, French and Chinese — every message editable.
No required dependencies. TreasureSpawn runs on its own. WorldGuard, DecentHolograms, MMOItems and Vault are all optional and activate automatically.

Installation

Get TreasureSpawn running in a minute — it needs no other plugin.

Steps

  1. Drop TreasureSpawn.jar into your server's plugins/ folder.
  2. Restart the server (Java 21 required for 1.21+).
  3. (Optional) Install WorldGuard, DecentHolograms, MMOItems or Vault for the extra features.
  4. Edit config.yml / loot.yml or use /tsadmin, then /ts reload.
ℹ️
Cooldowns are stored in SQLite (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.

SettingWhat it does
enabled-worldsWhich worlds chests can spawn in.
spawn-cooldownHow long each player waits between chests, as a random range (e.g. 300-900). It is per player, not shared.
min/max-distanceHow far from the player the chest appears (in blocks).
height-modesurface, underground or any, within min-y / max-y.
max-chests-per-worldAnti-lag cap on simultaneous chests.
despawn-timeSeconds before an unclaimed chest disappears.
cooldown-reductionsGive a permission to cut a player's personal cooldown by a % (for VIPs).
spawning.check-interval-secondsHow 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-checkHow 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-activityA player must have moved within the last activity-seconds to be included. This is what stops parked alt accounts collecting chests overnight.
📍
Admins can force one anytime with /ts spawn. The permission treasurespawn.bypass.cooldown ignores the wait entirely.
⏱️
A player's wait is their own, not a queue behind everyone else. Halve someone's cooldown with 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.

TierChanceBlockRolls
• Common70BARREL2–4
• Rare20CHEST3–5
• Legendary3PURPLE_SHULKER_BOX4–7
• Mythic1YELLOW_SHULKER_BOX5–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
🪙
Test a tier instantly with /ts give <tier> [player]. Everything (tiers, blocks, rolls, tables) is editable in config.yml / loot.yml or via /tsadmin.
⚠️
A chest is one use: the moment you close it, it is gone along with anything left inside. Opening one "just to look" costs the whole chest — warn your players. And since the same item is never rolled twice, a chest can never hold more items than its loot table has lines: asking for 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.

EffectWhat it does
Scream + launchGhast scream and the player is thrown into the air.
Potion effectsBlindness, poison… (your list, each with duration & level).
Creepers / mobsSpawn instantly-exploding creepers or an ambush of vanilla mobs.
Lightning / explosion / igniteCosmetic or real. Explosions still respect WorldGuard regions.
Cage / teleportTrap the player in cobweb/blocks briefly, or teleport them nearby (safe spot).
Money penaltyTake money via Vault.
Fake loot / commandsOpen a chest full of junk (troll), or run any console commands.
LUCKY mimicSkips all traps and rewards the player from a loot table instead.
👹
Everything is off by default except the classic scream/launch/potion/creeper set — turn on only what fits your server.

Protection, holograms & hooks

Keep chests fair and good-looking, and let them respect your existing plugins.

FeatureWhat it does
Private chestsenable-protection: only the player who triggered the chest can loot it.
Timed releaseprotection-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-canningStop players from breaking chests or dumping items inside.
WorldGuardDon't spawn where a player can't build, a strict "no regions at all" mode, and a per-region treasurespawn flag.
HologramsA floating label above each chest (DecentHolograms), fully formatted, showing the tier.
Spawn effectsConfigurable sound + particles when a chest appears.
🛡️
All hooks are optional — the plugin runs fine without WorldGuard, DecentHolograms, MMOItems or Vault, and each turns on automatically if present.

Commands

Base command /treasurespawn — aliases /ts, /treasure, /randomchest.

CommandWhat it does
/ts spawnForce-spawn a random chest near you (admin)
/ts give <tier> [player]Give / place a chest of a tier
/ts reloadReload the config & languages
/ts verPlugin version & author
/tsadminOpen the admin GUI

Permissions

Grant these with LuckPerms or any permissions plugin.

PermissionWhat it doesDefault
treasurespawn.spawnChests can spawn near this player. Revoke it and they receive none.true
treasurespawn.adminAdmin commands & GUIop
treasurespawn.bypass.cooldownAsk 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.

SectionWhat it controls
language · databaseLanguage and SQLite/MySQL cooldown storage
spawn settingsWorlds, cooldown, distance, height mode, Y limits, max chests, despawn
cooldown-reductionsPer-permission % cooldown cuts for VIPs
chest-typesYour tiers: chance, loot table, block, rolls, title
protection & WorldGuardPrivate chests, no breaking/placing, region rules
spawn-effects · hologramsSound + particles on spawn, floating labels
mimicTrap chance and every trap effect
loot.ymlThe 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 details

Spawn 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 moved

A 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 region

Spawn 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 lines

Mimic 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
ℹ️
After editing, run /ts reload (or use /tsadmin). Your config.yml is never overwritten on update — new options are added automatically, keeping your settings.
TreasureSpawn / Changelog

Version history

Every release and what changed in it.

v1.1 2026-08-17 Latest
  • 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.
v1.0 2026-08-02

No notes for this version.

TreasureSpawn / Discussion

Discussion

Comment and share your experience on each plugin version.

Log in to comment on this version.Log in

No comments on this version yet — be the first!

TreasureSpawn / Reviews

Player reviews

What server owners think of this plugin.

5.0
★★★★★
1 reviews
Log in to leave a review.Log in
IN
infinity3113 ⭐ Staff🎰 SlotMachine⚔️ ElementalArms🛡️ GuardianStones 05 Aug 2026
★★★★★

Buen plugin!