> For the complete documentation index, see [llms.txt](https://ultimaterewards.athelion.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ultimaterewards.athelion.eu/api/events.md).

# Events

Bukkit events fired by the plugin that your own plugin can listen to.

All events live in the `eu.athelion.ultimaterewards.api.event` package and are fired on the Bukkit event bus, so they are registered the usual way with `@EventHandler`.

| Event                       | Cancellable | Fired when                                                      | Useful methods                                                      |
| --------------------------- | ----------- | --------------------------------------------------------------- | ------------------------------------------------------------------- |
| `PlayerPreClaimRewardEvent` | yes         | Right before a reward is claimed, before any action is executed | `getClaimer()`, `getClaimedReward()`, `getRewardActionsToExecute()` |
| `PlayerClaimedRewardEvent`  | no          | After a reward has been successfully claimed                    | `getClaimer()`, `getClaimedReward()`                                |
| `ReminderReceiveEvent`      | yes         | Before a player receives a reward reminder                      | `getReceiver()`, `getAvailableRewards()`                            |
| `ReferralCreateEvent`       | yes         | A player is creating their own referral code                    | `getCreator()`                                                      |
| `ReferralApplyEvent`        | yes         | A player is applying someone else's referral code               | `getApplier()`, `getReferrer()`                                     |
| `UserLoadedEvent`           | no          | A player's data has finished loading                            | `getUser()`                                                         |
| `UserUnloadEvent`           | no          | A player's data is being unloaded (on quit)                     | `getUser()`                                                         |

{% hint style="warning" %}
`UserLoadedEvent` can be fired asynchronously — check `isAsync()` before touching the Bukkit API from the handler.
{% endhint %}

{% hint style="info" %}
`PlayerPreClaimRewardEvent` hands you the list of actions that are about to run. Modifying that list changes what the player actually receives; cancelling the event stops the claim entirely.
{% endhint %}

See [Examples](/api/examples.md) for a working listener.
