Skip to content

Custom Loot

amione edited this page Oct 24, 2024 · 2 revisions

Editing CustomLoot.json in Darkwood

In this guide, we’ll walk through how to edit CustomLoot.json to modify loot tables for specific enemies or objects using this mod. You will use item IDs from ItemLog.log to add, replace, or tweak loot drops.

Understanding CustomLoot.json

The CustomLoot.json file defines what items an entity (like an enemy or container) can drop. It uses a simple format with several fields:

  • enabled: Determines if custom loot is activated for the entity.
  • replace: If set to true, the entity’s original loot is replaced with the custom loot. If false, it adds the custom loot in addition to the default loot.
  • items: A list of items the entity can drop, with values for item name, amount, and chance of dropping.

Example format:

{
  "Dog": {
    "enabled": true,
    "replace": true,
    "items": [
      {
        "item": "lockpick",
        "minAmount": 1,
        "maxAmount": 1,
        "chance": 1.0
      },
      {
        "item": "lockpick",
        "minAmount": 5,
        "maxAmount": 5,
        "chance": 0.5
      }
    ]
  }
}

In this example:

  • The loot table of dogs has been modified.
  • enabled is set to true, meaning the loot table will be used.
  • replace is true, so any default loot will be replaced with the specified loot.
  • Two items have been defined: one that adds 1 lockpick with 100% chance, and another that adds 5 lockpicks with 50% chance.