Loot - clockworktownsmp/clockwork-bosses GitHub Wiki

Loot

You can set rewards for templates and presets on the Loot page in version 0.1. Choose Entry editor for built-in item rewards, or Datapack table for a server loot-table ID.

Enable loot, choose the reward source, and decide whether to keep or replace vanilla table drops. Missing loot sections stay disabled.

Add item rewards

  1. Open the template or preset in the editor.
  2. Open Loot and choose Entry editor.
  3. Open Reward entries → Add item.
  4. Search the creative-style icon grid, using native creative categories and vanilla/mod item IDs.
  5. Set the item's quantity range and independent drop chance.
  6. Add, reorder, edit, or remove entries as needed.
  7. Save. For an active template, use Reload saved to apply saved changes to loaded bosses.

Each reward entry gets its own drop roll. You could get several rewards from one kill, so don't treat the list as a choice of one item.

Basic entries give players default items. You can't edit advanced enchantments/components in the 0.1 entry editor yet; that's a future extension.

Use a datapack table

Choose Datapack table and enter the server loot-table ID in the Loot page. Configure enabled state and the keep/replace-vanilla-drops option, then Save and Reload saved as appropriate.

You can switch sources without deleting your existing datapack IDs, entries, or unrelated extension data. That lets you try the other setup and keep what you already have.

Configuration fields and limits

The Loot section contains these fields:

Field Meaning
enabled Enables or disables loot.
source entries for built-in item rewards or table for a datapack table. Omission preserves the legacy table source.
loot_table Server loot-table ID used by the table source.
vanilla_drops keep retains vanilla table drops; replace replaces them.
entries A named object containing 0–32 built-in reward entries, not an array.

Each item entry uses type: "item" and these fields:

Field Meaning and limit
item A registered, non-air item ID, at most 256 characters.
min_count Inclusive minimum quantity, integer 1–64.
max_count Inclusive maximum quantity, integer 1–64; must be at least min_count.
chance Independent drop chance: 0–1 in the file, displayed as 0–100% in the GUI.

A reward list supports at most 32 entries. Entry keys are 1–48 characters, using lowercase letters, digits, underscores, or hyphens.

This partial template gives reward_1 an independent 25% chance to grant 2–5 diamonds and replaces vanilla table drops:

{
  "loot": {
    "enabled": true,
    "source": "entries",
    "loot_table": "",
    "vanilla_drops": "replace",
    "entries": {
      "reward_1": {
        "type": "item",
        "item": "minecraft:diamond",
        "min_count": 2,
        "max_count": 5,
        "chance": 0.25
      }
    }
  }
}

Use "vanilla_drops": "keep" if you want to retain the vanilla table drops as well. Merge the example into the existing template, then Save and Reload saved as appropriate.

When rewards run

Native rewards run once when the boss's death is committed. An empty reward list skips native table/context construction. Invalid saves retain the previous file.

Changing a preset only affects templates you copy from it afterward. To test loot, save and reload your active template, then actually kill its boss.

Editing safely

Use the field limits shown by the editor and its validation feedback. Version 0.1 bounds numeric text, precision, and exponents before formatting or arithmetic. Extreme imported percentages still appear in compact form, but invalid edits aren't saved.

The searchable entry editor is available in 0.1. You do not need a datapack just to add ordinary item quantities and chances.