> For the complete documentation index, see [llms.txt](https://docs.sparkframework.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sparkframework.dev/documentation/developer-guide/plugins/combat/events.md).

# Events

All events published by the Combat plugin through `SparkEventBus`.

## Core Combat Events

| Event                  | Properties                                                              | Description              |
| ---------------------- | ----------------------------------------------------------------------- | ------------------------ |
| `CombatStartedEvent`   | `CombatEntity`                                                          | An entity entered combat |
| `CombatEndedEvent`     | `CombatEntity`, `CombatDuration`                                        | An entity left combat    |
| `EntityDeathEvent`     | `Entity`, `CombatEntity`, `Killer`                                      | An entity died           |
| `TargetChangedEvent`   | `PreviousTarget`, `NewTarget`                                           | Active target switched   |
| `TargetLockedEvent`    | `LockerEntity`, `TargetEntity`, `TargetGameObject`                      | Target lock acquired     |
| `TargetUnlockedEvent`  | `LockerEntity`, `PreviousTargetEntity`, `PreviousTargetGameObject`      | Target lock released     |
| `ThreatChangedEvent`   | `NPCEntity`, `ThreatSource`, `ThreatAmount`, `NewTotalThreat`, `Reason` | NPC threat table updated |
| `StartAutoAttackEvent` | `Target`                                                                | Auto-attack initiated    |

## Ability Execution Events

| Event                          | Properties                                                         | Description               |
| ------------------------------ | ------------------------------------------------------------------ | ------------------------- |
| `AbilityExecutedEvent`         | `Ability`, `Targets`, `WasSuccessful`                              | Ability fully executed    |
| `AbilityHitEvent`              | `SourceEntity`, `TargetEntity`, `Ability`, `HitPosition`, `Damage` | Ability hit a target      |
| `AbilityValidationFailedEvent` | `Ability`, `FailureReason`, `Target`                               | Ability failed validation |
| `AbilityUnlockedEvent`         | `Ability`, `EntityId`, `BarIdentifier`, `SlotIndex`                | Ability became available  |

## Ability Phase Events

These events fire as an ability transitions through its execution phases.

| Event                      | Properties                                         | Description                     |
| -------------------------- | -------------------------------------------------- | ------------------------------- |
| `AbilityStateChangedEvent` | `Ability`, `StateType`, `PreviousState`, `Targets` | Ability changed execution phase |
| `AbilityStartupEvent`      | `Ability`, `StateType`, `PreviousState`, `Targets` | Ability entered startup phase   |
| `AbilityActiveEvent`       | `Ability`, `StateType`, `PreviousState`, `Targets` | Ability entered active phase    |
| `AbilityRecoveryEvent`     | `Ability`, `StateType`, `PreviousState`, `Targets` | Ability entered recovery phase  |
| `AbilityCompletedEvent`    | `Ability`, `StateType`, `PreviousState`, `Targets` | Ability execution finished      |

## Channel & Incantation Events

| Event                                | Properties                          | Description                   |
| ------------------------------------ | ----------------------------------- | ----------------------------- |
| `AbilityChannelStartedEvent`         | `AbilityEntry`, `Caster`            | Channel cast began            |
| `AbilityChannelInterruptedEvent`     | `AbilityEntry`, `Caster`, `Context` | Channel was interrupted       |
| `AbilityChannelCompletedEvent`       | `AbilityEntry`, `Caster`            | Channel finished successfully |
| `AbilityIncantationStartedEvent`     | `Ability`, `Caster`                 | Incantation cast began        |
| `AbilityIncantationInterruptedEvent` | `Ability`, `Caster`                 | Incantation was interrupted   |

## Damage & Healing Events

| Event                        | Properties                                                                                                                         | Description              |
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| `DamageDealtEvent`           | `TargetEntity`, `DamageAmount`, `TargetStat`, `Ability`, `SourceEntity`, `MainDamageType`, `SecondaryDamageType`, `FormulaUsed`    | Damage applied to entity |
| `ObjectDamageDealtEvent`     | `TargetEntity`, `ObjectDamage`, `Ability`, `SourceEntity`, `MainDamageType`, `SecondaryDamageType`, `FormulaUsed`                  | Damage applied to object |
| `HealingAppliedEvent`        | `TargetEntity`, `HealingAmount`, `TargetStat`, `Ability`, `SourceEntity`, `MainHealingType`, `SecondaryHealingType`, `FormulaUsed` | Healing applied          |
| `NPCStaggerEvent`            | `TargetNPC`, `StaggerDuration`                                                                                                     | NPC was staggered        |
| `RevivePlayerRequestedEvent` | `EntityId`                                                                                                                         | Player revive requested  |

## Status Effect Events

| Event                  | Properties                                                       | Description                      |
| ---------------------- | ---------------------------------------------------------------- | -------------------------------- |
| `StatusAppliedEvent`   | `StatusInstance`, `TargetEntity`, `SourceEntity`, `WasStacked`   | Status effect applied            |
| `StatusRefreshedEvent` | `StatusInstance`, `NewStackCount`, `NewDuration`, `TargetEntity` | Status duration/stacks refreshed |
| `StatusRemovedEvent`   | `StatusInstance`, `Reason`, `TargetEntity`                       | Status effect removed            |
| `StatusTickEvent`      | `StatusInstance`, `TickNumber`, `TargetEntity`                   | Status periodic tick fired       |
| `StatusImmuneEvent`    | `BlockedStatus`, `TargetEntity`, `ImmunityTags`                  | Status blocked by immunity       |

## Stat & Override Events

| Event                          | Properties                                                     | Description                             |
| ------------------------------ | -------------------------------------------------------------- | --------------------------------------- |
| `StatModificationEvent`        | `Target`, `StatId`, `Value`, `ModificationType`                | Stat value modified                     |
| `BatchStatModificationEvent`   | `Target`, `Modifications`                                      | Multiple stats modified at once         |
| `AbilityTriggersOverrideEvent` | `Target`, `OverrideTriggers`, `IsClearingOverrides`, `Context` | Ability triggers temporarily overridden |
| `CombatTriggersOverrideEvent`  | `Target`, `OverrideTriggers`, `IsClearingOverrides`, `Context` | Combat triggers temporarily overridden  |

## NPC Events

| Event                | Properties                                  | Description                   |
| -------------------- | ------------------------------------------- | ----------------------------- |
| `NPCInteractedEvent` | `NPCEntry`, `Interactor`, `InteractableNPC` | Player interacted with an NPC |

See [Event System](/documentation/developer-guide/core-systems/event-system.md) for full details on subscribing, publishing, and handling events.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sparkframework.dev/documentation/developer-guide/plugins/combat/events.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
