CONTENT CONTRACT · VERSION 1
item
An inventory item with a localized name, stack limit and optional script-driven use.
Signature
{ description: (TextKey)?, equip: (ItemEquipment)?, icon: (TextureAssetId)?, id: ContentId, kind: "item", max_stack: PositiveCount, name: TextKey, place: (Placement)?, spell: (ItemSpell)?, tags: {TagId}, use: (ItemUse)? }Fields
| Name | Type | Meaning |
|---|---|---|
description | TextKey | Localized one-line description shown with the item. Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$; Reference: text |
equip | ItemEquipment | Presence makes this item equippable; at least tool or light is required. |
icon | TextureAssetId | Inventory and hand icon of the item. Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$; Reference: asset:texture |
id | ContentId | Unique definition ID in the declaring package namespace. Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$ |
kind | "item" | Discriminant |
max_stack | PositiveCount | Maximum units in one stack. Range: 1…2147483647; Unit: count |
name | TextKey | Localized item label, resolved in the package base locale. Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$; Reference: text |
place | Placement | How the item enters the world when placed; absent items cannot be placed. |
spell | ItemSpell | Presence makes the item a spell: bound to its owner (never dropped, stored or traded), cast through its use for mana. |
tags | {TagId} | Unordered unique membership tags; registry sorts them. Items: 0…4096; Unique entries |
use | ItemUse | Explicit item use contract; absent for items without a use action. |
Validated example
{
"icon": "core:apple_icon",
"id": "core:apple",
"kind": "item",
"max_stack": 999,
"name": "core:apple_name",
"tags": [],
"use": {
"cooldown_ticks": 1,
"parameters": {
"amount": 15,
"stamina": 10
},
"reach_mm": 0,
"script": "core:eat",
"snapshot": {
"anchors": [],
"definitions_from": [
"core"
],
"radius_mm": 0,
"variables": []
},
"target_scope": "self"
}
}