Skip to content

ItemIdentifiedEvent

A magic item was identified, and the party now knows what it is.

Full documentation: ItemIdentifiedEvent. Wire type: item_identified.

Default visibility: player

Message codes: items.item.identified

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 magic item was identified, and the party now knows what it is.\n\nEmitted the first time an item is used in a way that reveals it, which can happen\nin `UseItem`,\n`EquipItem`, and\n`ResolveBattleRound`, and when the\nreferee identifies it with `IdentifyItem`.\n\nBefore this, player-visible events contain only the item's `instance_id`. After it,\nyou can show the party the name of the item whose catalog id is `template_id`.",
  "properties": {
    "code": {
      "default": "items.item.identified",
      "title": "Code",
      "type": "string",
      "description": "The message code, always `items.item.identified`."
    },
    "visibility": {
      "$ref": "#/$defs/Visibility",
      "default": "player",
      "description": "Player visibility: this is the moment the party learns what it has."
    },
    "event_type": {
      "const": "item_identified",
      "default": "item_identified",
      "title": "Event Type",
      "type": "string",
      "description": "The event type, `item_identified`, which identifies this class in serialized form."
    },
    "instance_id": {
      "title": "Instance Id",
      "type": "string",
      "description": "The session-scoped id of the item, the same id the earlier events contained."
    },
    "template_id": {
      "title": "Template Id",
      "type": "string",
      "description": "What it turned out to be, as its magic item catalog id."
    }
  },
  "required": [
    "instance_id",
    "template_id"
  ],
  "title": "ItemIdentifiedEvent",
  "type": "object"
}