RemoveItem
Referee: take an item away from a member, the inverse of GrantItem.
Full documentation: RemoveItem. Wire type: remove_item.
Legal session modes: battle, encounter, exploring, game_over, town, victory
JSON Schema
{
"description": "Referee: take an item away from a member, the inverse of `GrantItem`.\n\nUse it when your game takes something the party has: armour a shop buys back, a quest\nitem used up when the quest completes, or an offering left on an altar. The item is\ndestroyed, not dropped, so the party can't pick it back up. When your game pays for the\nitem, also send `GrantCoins`. This command is legal in\nevery mode, `game_over` and `victory` included.\n\nName the item in `item_id`, by one of two kinds of id. A mundane item, like a torch, has a\ncatalog id, and a member can carry several units of it. Set `quantity` to the number of units\nto take. A magic item or a valuable has an instance id, which names one item, so `quantity`\nstays 1.\n\nThe session takes an equipped item off before it removes it. Any effect the item attached\nends, as it would with `UnequipItem`. A revealed\ncurse doesn't stop the removal, because a curse stops only the bearer from taking the item\noff. The command makes no draws and takes no time.\n\nModes:\n `town`, `exploring`, `encounter`, `battle`, `game_over`, `victory`\n\nRejections:\n - `session.command.unknown_member` - `character_id` matches no party member.\n - `items.remove.not_carried` - the member doesn't carry `quantity` units of\n `item_id`, or `item_id` is an instance id and `quantity` isn't 1.\n\nEvents:\n `ItemsRemovedEvent` with the removed\n items. When an equipped magic item's effects end, their events come first.",
"properties": {
"command_type": {
"const": "remove_item",
"default": "remove_item",
"title": "Command Type",
"type": "string",
"description": "The name that identifies the command class in serialized data. Each command class fixes\nit to a distinct snake_case string, like `\"move_party\"` or `\"open_door\"`, and constructing\nthe class sets it, so you never pass it yourself.\n`parse_command` and the\n`AnyCommand` union use it to rebuild the right class\nfrom a serialized mapping. A class's value never changes between releases."
},
"source": {
"anyOf": [
{
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Source",
"description": "Who or what issued the command on whose behalf: an authored trigger or quest id, or the\nname of one of your game's systems. The engine never reads it, so a command with a\n`source` does exactly what the same command without one does. The session logs and\nreplays it with the command, so the log alone shows why something happened. Leave it\n`None` when there's nothing to record. An empty string fails validation when the command\nis constructed."
},
"character_id": {
"title": "Character Id",
"type": "string",
"description": "The member who loses the item, by\n`MemberView.id`. A command you issue yourself has a\nmember id here, and the session refuses any other value with `session.command.unknown_member`.\nA consequence or a reward in an adventure document has a selector instead, because the\nsession assigns member ids when it starts. `\"@party\"` takes the item from every living\nmember, `\"@first\"` from the first living member, and `\"@carrier\"` from the first living\nmember in marching order who carries it. The trigger and quest interpreter replaces the\nselector with member ids before it issues the command."
},
"item_id": {
"title": "Item Id",
"type": "string",
"description": "Which item to take. A mundane item's catalog id, like `\"torch\"`, takes units from the\nmember's pack first and then from what the member has equipped. A magic item's or a\nvaluable's instance id, like `\"magic-item-0003\"` or `\"valuable-0002\"`, takes that one\nitem. The session refuses a magic item's catalog id with `items.remove.not_carried`,\nbecause two copies of a magic item can differ. Read instance ids from the member's\ninventory in the referee view."
},
"quantity": {
"default": 1,
"minimum": 1,
"title": "Quantity",
"type": "integer",
"description": "How many units of a mundane item to take. It has to be 1 for an instance id."
}
},
"required": [
"character_id",
"item_id"
],
"title": "RemoveItem",
"type": "object"
}