Skip to content

GrantItem

Referee: place an item directly into a member's inventory.

Full documentation: GrantItem. Wire type: grant_item.

Legal session modes: battle, encounter, exploring, game_over, town, victory

JSON Schema

{
  "description": "Referee: place an item directly into a member's inventory.\n\nReferee commands are legal in every mode, terminal modes included, and are\nlogged and replayed like any other.\n\nModes:\n    `town`, `exploring`, `encounter`, `battle`, `game_over`, `victory`\n\nRejections:\n    - `session.command.unknown_member` - `character_id` names no party member.\n    - `session.command.unknown_item` - `item_id` names no item in the session's\n      `effective_equipment`\n      catalog: neither a shipped id nor one the adventure bundles.\n\nEvents:\n    `ItemAcquiredEvent` with the\n    granted items, `origin` `\"grant\"`.",
  "properties": {
    "command_type": {
      "const": "grant_item",
      "default": "grant_item",
      "title": "Command Type",
      "type": "string",
      "description": "The wire discriminator. Each subclass fixes it to its own snake_case literal, like\n`\"move_party\"` or `\"open_door\"`, so you never set it yourself: constructing the subclass\ndoes. It's what `parse_command` and the\n`AnyCommand` union read to rebuild the right class\nfrom a serialized mapping, and it stays the same across releases."
    },
    "source": {
      "anyOf": [
        {
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Source",
      "description": "An annotation naming the authored object (a trigger or quest id) or the game\nsystem on whose behalf the command was issued. Execution never reads it: a stamped\ncommand does exactly what the same command unstamped does. It is logged and replayed\nwith the command, so the log alone answers \"why did this happen\". Absent is `None`,\nand the empty string is not a value."
    },
    "character_id": {
      "title": "Character Id",
      "type": "string",
      "description": "In an authored consequence or reward, this field takes the party selectors\n(`\"@party\"`, `\"@first\"`), expanded to literal member ids by the interpreter\nbefore issue. Issued directly, it must be a literal member id or the command\nrejects."
    },
    "item_id": {
      "title": "Item Id",
      "type": "string",
      "description": "Which item to create, from the session's\n`effective_equipment` catalog:\neither a shipped id from `load_equipment` (see the\nequipment id index) or one the adventure bundles. There's no purse check\nand no shop, so this is how a game hands out a reward, a found item, or a starting kit."
    },
    "quantity": {
      "default": 1,
      "minimum": 1,
      "title": "Quantity",
      "type": "integer",
      "description": "How many units to place, counted as individual items rather than as purchase lots:\n`quantity=6` grants six torches, which is the same count one purchase lot of torches\ndelivers through `PurchaseEquipment`."
    }
  },
  "required": [
    "character_id",
    "item_id"
  ],
  "title": "GrantItem",
  "type": "object"
}