> ## Documentation Index
> Fetch the complete documentation index at: https://entities.lodemc.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Events

> Bukkit events for addons: mob spawns, NPC interactions and reloads.

LodeEntities fires plain Bukkit events that addons listen to like any other. They live in `org.nexomaker.api.event`.

| Event | Fires when | Cancellable |
| - | - | - |
| `LodeEntitiesMobSpawnEvent` | A LodeEntities mob spawns: `/le spawn`, an egg, a spawner, the `summon` mechanic, or the API. The entity is already tagged. | Yes: removes the entity before its model and effects |
| `NpcInteractEvent` | A player right-clicks a `type: npc` mob. Carries the npc id, the entity and the player. | Yes: skips the NPC's dialog (its `+onInteract` lines still run) |
| `LodeEntitiesReloadedEvent` | After every load of mobs, skills and dialogs: boot and `/le reload`. May fire async. | No |

## LodeEntitiesMobSpawnEvent

Use it for region protection (no bosses in spawn), spawn limits, or logging. Cancelling removes the entity before its model and `+onSpawn` effects run.

## NpcInteractEvent

The hook for NPC behaviour beyond what a [dialog](https://entities.lodemc.net/dialogs.md) covers: open a shop inventory, gate an interaction behind quest progress, start a different [dialog](https://entities.lodemc.net/addon-npcs-dialogs.md#dialogs). Listen, cancel, and run your own logic.

```java theme={null}
@EventHandler
public void onNpcClick(NpcInteractEvent event) {
    if (event.getNpcId().equals("banker")) {
        event.setCancelled(true); // suppress its dialog
        openBankUi(event.getPlayer());
    }
}
```

## LodeEntitiesReloadedEvent

Use it to refresh anything your addon derives from LodeEntities' registries, such as cached mob lists or generated content.

> [!WARNING]
>
> This one may fire asynchronously. Hop back to the main thread before touching the world from a listener.

## Listening

Standard Bukkit listeners, nothing special: register them in your addon's `onEnable` as usual.

For model-level events (a model becoming visible, a hitbox being hit, an animation keyframe signal), see the engine's events in [Models & Animation](https://entities.lodemc.net/addon-models.md#engine-events).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.