Skip to content

Loot Tables

Loot tables define what items can drop when an enemy is defeated. Each table has a list of possible drops with individual drop chances.

Via the Creator UI: Loot Tables → New

Or via the REST API:

Terminal window
curl -X POST http://localhost:8010/api/loot-tables \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Cave Goblin Drops",
"entries": [
{
"itemTemplateId": "ITM0018",
"chance": 0.80,
"minQuantity": 1,
"maxQuantity": 2
},
{
"itemTemplateId": "ITM0006",
"chance": 0.50,
"minQuantity": 1,
"maxQuantity": 5
},
{
"itemTemplateId": "ITM0021",
"chance": 0.05,
"minQuantity": 1,
"maxQuantity": 1
}
]
}'
FieldDescription
itemTemplateIdItem template to drop
chanceDrop probability (0.0–1.0; 1.0 = always)
minQuantityMinimum quantity dropped
maxQuantityMaximum quantity (random in range)

Set lootTableId on the enemy’s NPC template:

{
"enemyTrait": {
"lootTableId": "LT0003",
"goldDrop": 5
}
}

When an enemy dies:

  1. Gold drops to the room (if goldDrop > 0)
  2. Each loot entry is evaluated independently with its chance
  3. For entries that trigger, quantity is rolled between min and max
  4. Items are created from templates and dropped to the room

For a level 2 enemy:

ItemChanceQtyNotes
Common loot (crafting mat)80%1-3Always worth picking up
Currency (copper)50%2-8Keeps economy flowing
Consumable (potion)20%1Nice surprise
Rare equipment2%1Exciting, not expected