Loot
Add extra drops to an enemy: what drops, how often, how many, and from what level.
The loot table adds drops on top of what an enemy already drops. The original drops stay, and you simply give that enemy an extra list. The enemy can be a base game one or a creature you added.
In the editor#
Open the Loot tab, which sits in the Rules group in the left column, and press Add. Each entry is named after the enemy.
| Field | What it does |
|---|---|
| Which enemy | Beating this enemy also drops the items below. Mod creatures work too. |
| Extra drops | Up to 16 rows, and each row rolls its own chance. A row has: Item (a base item or one from this mod), Drop chance (per kill; 1 means it always drops, and the form shows it as "about 1 in N"), At least, At most, and Enemy level at least (leave empty for no limit). |
The right column shows bars for each drop: how often it drops and how many you get.
To test, press the top-bar Test, then beat that enemy in the test arena a few times.
Advanced: writing the JSON by hand#
Below is the same content as it looks in the file. The editor saves exactly this format. You can also press Open folder at the top of the editor and edit the file in an outside text editor; when you save, the editor picks up the change. Fields the form does not show are kept as they are. Where the file goes and how it is listed: Mod folder and mod.json.
The table is one JSON file; put its path under content.loot in mod.json.
Smallest working example#
Give the Frost Wolf a 50% chance of dropping 1 to 2 wolf pelts, plus a 10% chance of raw meat, but only from enemies of level 5 or higher:
[
{
"enemy": "FROST_WOLF",
"drops": [
{ "item": "wolf_pelt", "chance": 0.5, "min": 1, "max": 2 },
{ "item": "raw_meat", "chance": 0.1, "min": 1, "max": 1, "minLevel": 5 }
]
}
]Fields#
| Field | Required? | What it means | Allowed values |
|---|---|---|---|
enemy | Yes | Which enemy gets the extra drops | A base game creature id in capitals (for example ZOMBIE, WOLF, FROST_WOLF), the local id of a creature you added, or @modid/name |
drops | Yes | The list of extra drops | 1 to 16 entries |
drops[].item | Yes | What drops | An item id: base game, your own, or @modid/name |
drops[].chance | Yes | Drop chance; 1 means always | 0.001 to 1 |
drops[].min | No | Fewest dropped | Whole number, 1 to 99. Default 1 |
drops[].max | No | Most dropped | Whole number, 1 to 99, not below min. Same as min if missing |
drops[].minLevel | No | The enemy must be at least this level for this drop | Whole number, 1 to 200 |
How it points at other things#
- For a base game creature, write its id in capitals. For one of your own creatures, write the local id from your species table.
itemcan be anything of yours: an item, a fish, a dish, or a crop seed (<crop id>_seed). Loot loads late inside a mod, so all of these can be found.- Something from another mod is written
@modid/name, and that mod must be independsOn.
Common mistakes#
- Leaving out
chance. Every drop needs one. - Writing
chanceas 50 thinking it means 50%. Chances are 0 to 1, so half is0.5. Below 0.001 is not allowed either. maxsmaller thanmin.- An empty
dropslist, or more than 16 entries. - A creature id in lowercase (
zombie). Base game creatures are in capitals,ZOMBIE. The game says there is no creature called "zombie". - A misspelled item id. The game says there is no item called "something".
Related pages#
- Items: the things you want to drop.
- Species: your own enemies, which can list their own drops directly.
- Dishes: a dropped dish has to exist first.
- The mod editor: build this kind of content with forms and test it in the game.