Skip to content

Custom‐Loot.md

Fragmer2 edited this page Apr 8, 2026 · 3 revisions

Custom Loot System Guide

Overview

The Custom Loot System lets you build your own loot tables for each chest tier using an in-game GUI. No YAML editing required.


Opening the Editor

/putintothechest

Aliases: /customloot · /chestloot · /editloot
Permission: spawnchest.admin

Opens the Main Menu with three tier icons — Common, Rare, and Legendary. Click any tier to edit its loot table.


Edit Menu Layout

Single Chest (27 slots)

┌──────────────────────────────────────────┐
│  0   1   2   3   4   5   6   7   8       │  Row 1: Items
│  9  10  11  12  13  14  15  16  17       │  Row 2: Items
├──────────────────────────────────────────┤
│ [◀] [▶] [📄] [▶] [💾] [⬅] [🚫]         │  Controls
└──────────────────────────────────────────┘
  Type   -  Info  +  Save Back Reset

Double Chest (54 slots)

┌──────────────────────────────────────────┐
│  Rows 1–5: Items (45 slots)              │
├──────────────────────────────────────────┤
│ Controls (9 slots)                       │
└──────────────────────────────────────────┘

Control Buttons

Chest Type Toggle — Slot 1

Switches between Single (27 slots, 18-item area) and Double (54 slots, 45-item area).

Single → Double: All items carry over to the larger chest.

Double → Single: First 18 items stay. Any remaining items drop at your feet with a message showing how many dropped.

Settings (fraction and chest type preference) are always preserved through size changes.


Fraction Decrease — Slot 3

Moves the drop rate down: All → 1/2 → 1/3 → 1/4 → … → 1/10


Fraction Display — Slot 4

Shows the current drop rate. Click-through only, not interactive.


Fraction Increase — Slot 5

Moves the drop rate up: 1/10 → … → 1/3 → 1/2 → All


Save — Slot 6

Saves all items from the chest area, enables custom loot for this tier, then returns to the main menu.

Saved 15 items for common chests.

Back — Slot 7

Returns to the main menu without saving.


Reset — Slot 8

Opens a two-step confirmation flow before clearing items.


Reset Confirmation

Step 1 — First Warning

Shows tier name, current item count, and a reminder that chest type and fraction are preserved. Options: Continue or Cancel.

Step 2 — Final Confirmation

Last chance. Confirms that all items will be deleted (dropped at your feet) and custom loot disabled. Options: Confirm or Cancel.

What gets reset:

  • All saved items (dropped at your location)
  • Custom loot enabled status

What is preserved:

  • Chest type (single / double)
  • Item fraction setting

Adding Items

Method 1 — Click from inventory

Click an item in your inventory while the edit menu is open. It moves into the chest area.

Method 2 — Shift-click

Shift-click an item in your inventory. It moves to the first empty slot in the chest area automatically.

All item properties are preserved:

  • Enchantments
  • Custom names and lore
  • Custom model data
  • NBT data
  • Durability / damage value

Item Fraction System

When a chest spawns the plugin:

  1. Takes all saved items from your loot table
  2. Shuffles them randomly
  3. Picks the configured fraction
  4. Places those items in the chest

Fraction Examples

Saved Items Fraction Items per Chest
30 All 30
30 1/2 15
30 1/3 10
30 1/4 7–8
30 1/10 3

Best Practices

Balance quantities. Avoid stacking 64 of every valuable item. Mix 1–5 high-value items with a larger filler pool.

Mix item categories. A chest with only diamonds is boring and unbalanced. Aim for weapons, armor, tools, food, materials, and potions.

Use fractions for variety. A pool of 30 items with 1/3 fraction means each spawn feels different. Players have a reason to open more than one chest.

Test before events. Save your loot table, run /chestnow, and open the chest to see what spawns. Adjust fraction or item counts as needed.


Example Loot Tables

Balanced Common Chest

Type: Single · Fraction: 1/2 · Pool size: 18

Weapons, iron armor, basic tools, food, common materials, a few ender pearls.

Rich Rare Chest

Type: Double · Fraction: 1/3 · Pool size: 45

Enchanted diamond gear, potions of Strength/Speed, golden apples, netherite scrap, elytra, totem of undying, enchanted books.

OP Legendary Chest

Type: Double · Fraction: All · Pool size: 30

All nine legendary items, netherite ingots, enchanted golden apples, max-enchanted netherite armor, Summoner Apples, totems.


Troubleshooting

Items not appearing in spawned chest

  1. Did you click Save?
  2. Is the tier shown as enabled (green) in the main menu?
  3. Is the fraction too low? 1/10 of 5 items = 0–1 items.

Cannot place items in the edit area

  1. Make sure you are clicking inside the item area, not the control row.
  2. Check if the area is full (18 slots for single, 45 for double).

Items dropped on chest type change This is expected when switching from Double to Single. Items that do not fit drop at your feet.

Reset did not work Both confirmation steps must be completed. Check custom_loot.yml — the items list should be empty after a successful reset.


Manual YAML Editing

File: plugins/SpawnChestPlugin/custom_loot.yml

common:
  enabled: true
  double-chest: false
  item-fraction: "one-third"
  items:
    - ==: org.bukkit.inventory.ItemStack
      v: 3700
      type: DIAMOND_SWORD
      meta:
        ==: ItemMeta
        meta-type: UNSPECIFIC
        display-name: "§cCustom Sword"
        enchants:
          DAMAGE_ALL: 5

rare: enabled: false double-chest: true item-fraction: "one-half" items: []

legendary: enabled: true double-chest: true item-fraction: "all" items: []

Manual editing is complex and error-prone. Use the GUI whenever possible.


FAQ

Can I configure each tier separately?
Yes. Common, Rare, and Legendary each have their own independent loot table.

Do I need to reload after saving?
No. Changes apply immediately.

Can I use items from other plugins?
Yes. Any item in your inventory can be added, including items with custom plugin data.

Is there a maximum pool size?
Single chest: 18 items. Double chest: 45 items.

Can I copy loot tables between servers?
Yes. Copy custom_loot.yml to the other server.

What happens to already-spawned chests after I change the loot?
Existing spawned chests keep the loot they already have. Only new spawns use the updated table.

Clone this wiki locally