Loot Table Configuration

Define standalone, named loot tables used to randomly fill an entity's inventory when it spawns.

Standalone, named loot tables used to randomly fill an entity’s or static object’s inventory when it spawns (referenced by name via a loot-table field on a mob/static-object spawn definition). This is a different, weighted-pick system from the simple drop-table block used by interactables/mobs/trees/mounts for their break/death drops — see Drop Table vs Loot Table below.


File Location

Register the file in your mod’s manifest (mods/<YourMod>/<YourMod>.yaml):

loot-table-config: loot-table-config.yaml

Then create the file it points to, relative to your mod’s folder:

mods/<YourMod>/loot-table-config.yaml

The file is a single list of loot table entries:

loot-tables:
  - name: my_chest_loot
    min-rolls: 1
    max-rolls: 3
    entries:
      - item: wooden_stick
        min-amount: 1
        max-amount: 5
        weight: 0.5
      - item: oak_planks
        min-amount: 1
        max-amount: 5
        weight: 0.5
      - item: wooden_axe
        min-amount: 1
        max-amount: 1
        weight: 0.2

Names are automatically prefixed with your mod name unless you write one already containing a colon.

The entries list must have at least one entry — an empty pool is rejected at load. Any unknown key inside a loot table or entries entry is also a load-time error, so a misspelling fails loudly instead of being silently ignored. Defining two tables with the same name logs a warning (the later one wins).

If a structure or structure-link spawn references a loot-table: name that no loaded mod defines (e.g. a typo), the server logs a warning at startup naming the structure and the missing table — the spawn would otherwise just receive no loot with no indication why.

Guaranteed drops

Alongside the weighted entries pool, a table can declare an optional guaranteed list of drops that are always emitted on every fill, independent of min-rolls/max-rolls. Use it for the item a container must always contain (a quest key, a starter tool) on top of its random loot:

loot-tables:
  - name: dungeon_chest
    min-rolls: 1
    max-rolls: 3
    guaranteed:
      - item: dungeon_key          # always exactly one
      - item: gold_coin
        min-amount: 5
        max-amount: 10             # always 5–10, still guaranteed
    entries:
      - item: wooden_stick
      - item: wooden_axe
        weight: 0.2

Each guaranteed entry takes the same item, min-amount/max-amount, and amount fields as a entries entry — but not weight (a guaranteed drop is never in the weighted lottery, so a stray weight: here is a load-time error). Each guaranteed entry fills its own slot, placed before the weighted rolls. If the container has fewer slots than guaranteed entries, the overflow is silently dropped — the same slot-capacity limit the rolls hit.


Fields

FieldDefaultDescription
name(required)The loot table’s identifier, referenced elsewhere via loot-table: <name>.
min-rolls / max-rolls(required)How many item slots to roll and fill from the weighted pool, picked randomly per spawn.
entries(required)The weighted pool of possible drops — see below.
guaranteed[]Optional list of drops always emitted on every fill, independent of the rolls — see Guaranteed drops. Same entry shape as entries minus weight.

Each entry in entries:

FieldDefaultDescription
item(required)The item to give. Either a bare item name (item: WOODEN STICK) or a full nested itemstack reference (item: with a name: and optional overrides — see crafting-config.md, which documents the identical form and its accepted keys).
min-amount / max-amount1 / 1Quantity range if this entry is picked.
amount(none)Shorthand for a fixed quantity: amount: 3 is the same as min-amount: 3 + max-amount: 3. Cannot be combined with min-amount/max-amount.
weight1.0A relative weight, not a probability — see below.

Only item is required — with everything else omitted, an entry gives one of that item at equal weight. So the minimal pool entry is just - item: WOODEN STICK, and an equal-odds table needs no weight: on any line. This matches the sibling drop-table shorthand.


Using a loot table as a drop table

A named loot table can be used directly wherever a drop-table is accepted — on a block, mob, mount, tree or interactable — by naming it instead of listing entries:

# in mob-config.yaml
drop-table:
  loot-table: boss_hoard

The table is rolled exactly as it would be when filling a container: every guaranteed entry, then min-rolls..max-rolls weighted picks. The results drop as loose items rather than filling an inventory.

loot-table is mutually exclusive with drops/groups — use one or the other, and declaring both is a load-time error rather than a silent precedence rule.

The name is mod-prefixed like any other reference, so a bare name means your own mod and OtherMod:their_table reaches across mods. The reference is resolved when the drop happens rather than at load, so mod load order never matters.


How Rolling Works

For each spawn, the game rolls a random number of slots between min-rolls and max-rolls, and fills that many random inventory slots. For each slot, it picks exactly one entry from entries, weighted by weight:

  • All weight values in the list are summed (this sum doesn’t need to add up to 1.0 or any particular total).
  • A random number is drawn between 0 and that sum, and the entry it lands on is picked.
  • Entries with a higher weight relative to the others are picked more often — a weight: 2.0 entry is twice as likely to be picked as a weight: 1.0 entry.

Any guaranteed drops are placed first — one per slot — and then the weighted rolls fill the remaining slots. Each roll fills a random empty-or-not inventory slot, and rolls are independent: the same entry can be picked for more than one slot (a 3-roll table over a 2-entry pool can hand out three stacks of the same item). Guaranteed drops plus rolls beyond the container’s slot count are silently ignored — a max-rolls larger than the inventory just fills every slot.

This is different from the drop-table block (used by interactables/mobs/trees/mounts/blocks): there, drops: entries roll independently as 0.01.0 probabilities (any number can drop) and groups: pick one weighted entry each. Here, exactly one item is picked per rolled slot.


Drop Table vs Loot Table

Loot Table (this doc)Drop Table (reference/shared-blocks.md)
Used forFilling a spawned entity/object’s inventoryItem drops when something breaks/dies
Weighting keyweight — relative weight, one entry picked per slotgroups: uses weight (relative, one entry picked per group — same as a loot table’s) and drops: uses chance (an independent 0.01.0 probability per entry)
Result countFixed by min-rolls/max-rollsdrops: zero-to-all; plus one per groups: group