Skip to content

Item Definition File

zcaliptium edited this page Feb 24, 2021 · 4 revisions

Description

Item Definition Files are simple JSON configs used to represent item prototypes. Should be stored at one of directories you specify in plugin settings. See Item Definition to understand purpose of each field.

Structure

<<Root Node>> {}
V
|--> id "dialog_identifier"
|--> attributes {}
     V
     ... each attribute (can be any json type) ...

Example 1 - Melee Weapon

That's only example that represents how You can organize data for your game.

{
    "id": "knife",
    "attributes": {
        "maxStackSize": 1,
        "type": "melee_weapon",
        "meleeDamage": {
          "min": 1,
          "max": 2
        }
    }
}

Example 2 - Consumable items

That's only example that represents how You can organize data for your game.

{
    "id": "medkit_1",
    "attributes": {
        "maxStackSize": 16,
        "type": "consumable",
        "on_consume": {
            "heal": 50
        }
    }
}
{
    "id": "armor_1",
    "attributes": {
        "maxStackSize": 16,
        "type": "consumable",
        "on_consume": {
            "armor": 20
        }
    }
}