Skip to content

ItemsRemovedEvent

A referee took items or coins away from a party member.

Full documentation: ItemsRemovedEvent. Wire type: items_removed.

Default visibility: player

Message codes: session.items.removed

JSON Schema

{
  "$defs": {
    "Visibility": {
      "description": "Who may see an event: the players, or only the referee.\n\nEvery event has one of these values, because in B/X the referee makes some rolls behind a screen. Filter\na log on it before you show anything to a player, or call\n`GameSession.view`, which builds the players' view and the referee's\nview for you. A narrator that plays the referee reads every event.\n\nA serialized event contains the lowercase value. The values stay fixed within a `schema_version`, the version\nstamp of the saved format.\n\nExamples:\n    ```python\n    from osrlib.core.events import DamageDealtEvent, HitPointsReportedEvent, Visibility\n\n    log = [\n        DamageDealtEvent(target_id=\"monster-0001\", amount=5),\n        HitPointsReportedEvent(target_id=\"monster-0001\", current_hp=2, max_hp=7),\n    ]\n    shown = [event.code for event in log if event.visibility is Visibility.PLAYER]\n    assert shown == [\"combat.damage.dealt\"]  # the goblin's remaining hit points stay hidden\n    ```",
      "enum": [
        "player",
        "referee"
      ],
      "title": "Visibility",
      "type": "string"
    }
  },
  "description": "A referee took items or coins away from a party member.\n\nEmitted by `RemoveItem` and\n`RemoveCoins`. What was removed has left the\ngame, so update the member's inventory on screen. The event doesn't say why. The\ncommand does: read the `source` of the `RemoveItem` or `RemoveCoins`, either the one you\nexecuted or its entry in\n`GameSession.command_log`. When a\ntrigger or a quest issued the command, `source` is its id.",
  "properties": {
    "code": {
      "default": "session.items.removed",
      "title": "Code",
      "type": "string",
      "description": "The message code, always `session.items.removed`."
    },
    "visibility": {
      "$ref": "#/$defs/Visibility",
      "default": "player",
      "description": "Player visibility: the party knows what it no longer has."
    },
    "event_type": {
      "const": "items_removed",
      "default": "items_removed",
      "title": "Event Type",
      "type": "string",
      "description": "The event type, `items_removed`, which identifies this class in serialized form."
    },
    "character_id": {
      "title": "Character Id",
      "type": "string",
      "description": "The member who lost the items or coins."
    },
    "item_ids": {
      "default": [],
      "items": {
        "type": "string"
      },
      "title": "Item Ids",
      "type": "array",
      "description": "The ids of what was removed: a mundane item's catalog id once for each unit, and the instance\nid of a magic item or a valuable. Empty for a removal of coins."
    },
    "coins_gp_value": {
      "default": 0,
      "title": "Coins Gp Value",
      "type": "integer",
      "description": "The coins removed, as their value in gold pieces. 0 for a removal of items."
    }
  },
  "required": [
    "character_id"
  ],
  "title": "ItemsRemovedEvent",
  "type": "object"
}