Docs/JSON

Loot

Configure loot rolls, presets, replacements and additions with loot.json.

API version 1Lua 5.1Updated 2026-11-07

How world loot is rolled, which items may roll, where, and the scenario's remove, replace and add rules. Live: /scenario reload applies it. Loot that is already in the world is not rerolled; use /respawnloot for that.

The default scenario spells out today's behaviour exactly, so a scenario that only adds a rules list (the original loot.json format) behaves as before. Every key is optional in a scenario file and layers over its base (see merging below).

{
  "rolls": {
    "world": {
      "pool": "table",
      "table_pick": "uniform",
      "range": [1, 100],
      "joker_roll": 100,
      "bands": [
        {
          "roll": [1, 1],
          "picks": [
            {
              "bucket": "Legendary",
              "count": [1, 1],
              "chance_pct": 10
            }
          ]
        },
        {
          "roll": [2, 5],
          "picks": [
            {
              "bucket": "Rare",
              "count": [0, 1]
            }
          ]
        },
        {
          "roll": [6, 25],
          "picks": [
            {
              "bucket": "Common",
              "count": [0, 4]
            }
          ]
        },
        {
          "roll": [100, 100],
          "picks": [
            {
              "bucket": "Legendary",
              "count": [1, 1],
              "chance_pct": 10
            },
            {
              "bucket": "Rare",
              "count": [1, 2]
            },
            {
              "bucket": "Common",
              "count": [4, 10]
            }
          ]
        }
      ]
    },
    "nomad": {
      "pool": "nomad",
      "range": [1, 30],
      "bands": [
        {
          "roll": [1, 1],
          "picks": [
            {
              "bucket": "Legendary",
              "count": [1, 1],
              "chance_pct": 10
            }
          ]
        },
        {
          "roll": [2, 5],
          "picks": [
            {
              "bucket": "Rare",
              "count": [0, 1]
            }
          ]
        },
        {
          "roll": [6, 25],
          "picks": [
            {
              "bucket": "Common",
              "count": [0, 4]
            }
          ]
        }
      ]
    }
  },
  "stash": {
    "first_roll_range": [0, 100],
    "pass_at_most": 10
  },
  "frozen": {
    "base_chance_pct": 10,
    "scale_with_season_blend": true
  },
  "pools": {
    "airdrop": {
      "any_flags": ["military"],
      "any_types": ["Weapon", "Magazine", "Ammo"]
    },
    "nomad": {
      "all_flags": ["civilian"],
      "not_types": ["Furniture"]
    }
  },
  "items": {},
  "source_tags": [],
  "filters": [],
  "tiers": {
    "normal": {
      "bucket_mult": {},
      "deny_item_tags": [],
      "allow_item_tags": []
    }
  },
  "default_tier": "normal",
  "rules": []
}

The roll#

rolls.world is what a container or ground loot spot rolls on every refresh.

  1. A source with no loot tables rolls nothing. Otherwise one of its tables is picked (table_pick is always "uniform"). A source marked force in the game data gives every entry of its table and skips the rest.
  2. The candidate items are the table's entries (an item listed twice counts twice), minus banned items, weight-0 items and what filters and the zone tier remove. Each candidate belongs to one bucket: the one whose rarity in the game export equals the item's rarity (Common, Rare or Legendary), or the bucket set by items.<name>.bucket.
  3. The die is range[0] to range[1], inclusive and uniform. Joker sources always roll joker_roll. The first band whose roll pair contains the die applies; no band means an empty roll (26 to 99 by default).
  4. Each pick in the band: with probability chance_pct (default 100) it draws count[0] to count[1] items from its bucket, each draw independent (the same item can come up twice), weighted by items.<name>.weight. An empty bucket draws nothing. Zone tiers can scale counts and gates (see tiers).
  5. Each drawn item becomes a slot through presets (context world). A Freezable item starts Frozen with probability frozen.base_chance_pct, times the season blend (0 summer to 1 winter) when scale_with_season_blend is true. A presets frozen_chance_pct replaces the base for that item.

rolls.nomad is the one-off loot of a Nomad body, rolled the first time the Nomad's loot is needed (when it dies or its saved body is touched). It draws from the named pool across the whole map catalog instead of a table; each bucket's candidates are sorted by item path, so a seeded roll is reproducible. It has no joker.

A band's roll pairs must lie inside range and must not overlap (the error names both bands). count pairs need min <= max; chance_pct is 0 to 100. bucket must be one of Common, Rare, Legendary. rolls.<name> replaces the inherited roll completely when a layer sets it.

stash: sources marked Stash (hidden caches) roll their first generation only when first_roll_range gives a value <= pass_at_most. By default that is 11 of 101. A failed stash stays absent until its next refresh: clients hide it and both client and server remove its collision. Once generated, the stash appears, becomes solid and can be opened.

pools#

A pool is a named item filter. Conditions: any_flags (an item flag from civilian, industrial, military), any_types (the exported item type), any_tags (an item tag, see below); an item needs to satisfy one of the non-empty any_* lists. all_flags (every flag) and not_types (exclusions) then narrow the result. A pool is used by rolls.*.pool and by the airdrop contents (events.json). Banned items are never in a pool.

items#

Key: an item name the way /give accepts it (name, file ID or resource path, ignoring case, spaces, _, - and ., and matching exactly one item).

FieldDefaultMeaning
weight1Relative chance within its bucket. 0 excludes the item from rolls.
banfalseRemoves the item from rolls, from rule add/replace targets, from pools (airdrops) and from the economy.
bucketexportPuts the item in Common, Rare or Legendary.
tagsnoneExtra item tags (^[a-z0-9_:]{1,32}$).

Item tags are the item's set flags (civilian, industrial, military), its exported type and subtype in lowercase, and the tags above.

source_tags and zones#

source_tags adds tags to loot sources: { "match": "medical", "kind": "container", "maps": ["Village"], "tags": ["medical"] }. match is a lowercase substring of the source's name; kind is container, ground or any (default). Every source also carries kind:container or kind:ground, map:<lowercase map name> and the tags of the zone that contains it. Tag names match ^[a-z0-9_:]{1,32}$.

filters#

{
  "when": {
    "tags": ["military"],
    "maps": ["Village"],
    "tiers": ["high"]
  },
  "allow_item_tags": ["weapon"],
  "deny_item_tags": ["furniture"],
  "deny_items": ["Grenade F1"]
}

A filter applies to a source when every given when condition holds (tags: the source has at least one of them). It narrows the candidates of step 2: allow_item_tags keeps only items with at least one of those tags, deny_item_tags and deny_items remove items.

tiers#

A tier is a loot grade zones can assign. default_tier (here normal) is the tier of sources outside every zone, and must exist.

  • bucket_mult ({bucket: number >= 0}, default 1): for a pick from bucket B with multiplier m, the count becomes count * m rounded stochastically (the whole part, plus one more with the probability of the fraction), and a chance_pct below 100 becomes min(100, chance_pct * m). 0 empties the bucket for the tier.
  • allow_item_tags and deny_item_tags filter the candidates like a filter.

rules#

The original remove, replace and add rules, unchanged in meaning. They run after the roll on each refreshed container or ground source (not on fixed world items).

{
  "rules": [
    {
      "comment": "No grenades lying around in Village.",
      "remove": "Grenade F1",
      "maps": ["Village"]
    },
    {
      "comment": "Some AKMs become AK-74s.",
      "replace": "AKM",
      "with": "AK-74",
      "chance": 0.3
    },
    {
      "comment": "Occasionally an extra medkit in medical cabinets.",
      "add": "Medkit",
      "kind": "container",
      "source": "medical",
      "chance": 0.1,
      "count": 1
    }
  ]
}

Each rule sets exactly one of remove, replace or add.

FieldUsed withDefaultMeaning
removeItem that should not spawn.
replace + withItem to swap, and the item it becomes.
addItem to add on top of the roll.
chanceall1Probability 0 to 1. For remove/replace it rolls per matching item; for add once per refreshed source.
countadd1Copies added, 1 to 20.
mapsallevery mapPublic map names (any case).
kindallboth"container" or "ground".
sourceallanyText the source's name must contain, ignoring case.
tagallanyA source tag (kind:ground, map:village, a source_tags tag or a zone tag).
tierallanyA zone tier name; must exist in tiers.
commentallFor people; ignored.

Rules run in file order. A matching remove drops a rolled item; a matching replace swaps it and later rules see the replacement; then each matching add appends its copies. Added and replacement items are built like any new loot item (presets, context world) but are never frozen, and a banned item is never added or swapped in. Containers keep what fits in their grid; the rest is dropped.

Not covered by rules: fixed world items, trader stock, airdrop crates, AI corpses, Nomad loot, starting kits, and anything already in the world.

Merging with the base scenario#

  • rolls.<name> replaces the whole inherited roll.
  • stash, frozen, items.<name>, pools.<name>, tiers.<name> merge key by key; null for an item, pool, tier or roll deletes the inherited entry.
  • source_tags, filters and rules are appended after the base's. Set "source_tags_mode", "filters_mode" or "rules_mode" to "replace" to drop the inherited list first.

Validation#

The file is checked strictly when the scenario loads or reloads: unknown keys (typos), unknown or ambiguous items, out-of-range numbers, overlapping bands, undefined pools or tiers, unknown maps, kinds and bucket names. Every message names the file of the scenario layer that set the value, the key path and the allowed range. At startup an error stops the server; on /scenario reload the running scenario stays.

Found a mistake or missing detail? Tell us in the Discord.