ItemConsumedEvent
One carried item was used up: a toll paid, a spike driven home.
Full documentation: ItemConsumedEvent. Wire type: item_consumed.
Default visibility: player
Message codes: exploration.item.consumed
JSON Schema
{
"$defs": {
"Visibility": {
"description": "Who is allowed to see an event.\n\nEvery event has one of these two values, and the split exists because B/X keeps some rolls behind the\nreferee's screen. Filter a log on it before you show anything to a player, or call\n`GameSession.view`, which builds the player's and the referee's\nviews for you. A narrator playing referee reads both.\n\nThe values are the lowercase strings and they serialize into every event, so a renamed value is a\n`schema_version` bump.\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": "One carried item was used up: a toll paid, a spike driven home.\n\nEmitted when a gate's condition takes the item it names, which happens on\n`OpenDoor`,\n`ForceDoor`, and\n`UseStairs`, and by\n`WedgeDoor` for the iron spike it drives.\n\nIt says the item is gone. It isn't the event for a potion drunk or a scroll\nread, which are `ItemUsedEvent`.",
"properties": {
"code": {
"default": "exploration.item.consumed",
"title": "Code",
"type": "string",
"description": "The message code, always `exploration.item.consumed`."
},
"visibility": {
"$ref": "#/$defs/Visibility",
"default": "player",
"description": "Player visibility: the party sees what it spent."
},
"event_type": {
"const": "item_consumed",
"default": "item_consumed",
"title": "Event Type",
"type": "string",
"description": "The wire discriminator, `item_consumed`."
},
"character_id": {
"title": "Character Id",
"type": "string",
"description": "The member whose pack the item came out of."
},
"item_id": {
"title": "Item Id",
"type": "string",
"description": "What was consumed: the catalog id for mundane gear, and the session-scoped instance id for\na magic item, never its template id, so an unidentified item's identity never reaches a\nplayer-visible event."
}
},
"required": [
"character_id",
"item_id"
],
"title": "ItemConsumedEvent",
"type": "object"
}