Skip to content

CharacterLeveledUpEvent

One character gained a level — the award's threshold crossing made visible.

Full documentation: CharacterLeveledUpEvent. Wire type: leveled_up.

Default visibility: player

Message codes: session.level.gained

JSON Schema

{
  "$defs": {
    "Visibility": {
      "description": "Who may see an event.\n\nThe wire values are `\"player\"` and `\"referee\"` \u2014 lowercase, serialized into every\nevent; changing them is a `schema_version` bump.",
      "enum": [
        "player",
        "referee"
      ],
      "title": "Visibility",
      "type": "string"
    }
  },
  "description": "One character gained a level \u2014 the award's threshold crossing made visible.\n\nFires immediately after the member's own\n[`XpAwardedEvent`][osrlib.crawl.events.XpAwardedEvent] whenever an XP award\ncrosses a level threshold, whichever surface awarded it (the end-of-adventure\naward, the immediate timing, or the referee's\n[`AwardXP`][osrlib.crawl.commands.AwardXP]). While the Hit Dice count still\ngrows, `hp_roll` is the raw die; past name level the gain is the flat-bonus\ndelta with no die, so `hp_roll` is `None` and `con_applied` is false. `title`\nis the class's level title at `level_after`, `None` past the printed title\nlist (the SRD's lists run only through name level).",
  "properties": {
    "code": {
      "default": "session.level.gained",
      "title": "Code",
      "type": "string"
    },
    "visibility": {
      "$ref": "#/$defs/Visibility",
      "default": "player"
    },
    "event_type": {
      "const": "leveled_up",
      "default": "leveled_up",
      "title": "Event Type",
      "type": "string"
    },
    "character_id": {
      "title": "Character Id",
      "type": "string"
    },
    "level_before": {
      "title": "Level Before",
      "type": "integer"
    },
    "level_after": {
      "title": "Level After",
      "type": "integer"
    },
    "hp_gained": {
      "title": "Hp Gained",
      "type": "integer"
    },
    "hp_roll": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Hp Roll"
    },
    "con_applied": {
      "title": "Con Applied",
      "type": "boolean"
    },
    "title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Title"
    }
  },
  "required": [
    "character_id",
    "level_before",
    "level_after",
    "hp_gained",
    "hp_roll",
    "con_applied",
    "title"
  ],
  "title": "CharacterLeveledUpEvent",
  "type": "object"
}