> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nmentities.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.

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

## NMEntitiesMobSpawnEvent

Fires when a registered mob is spawned through the pipeline: `/nme spawn`, the [Entities menu](gui) and its eggs, the `summon` mechanic, or the API.

**Cancellable:** yes. Cancel it to block the spawn.

Use it for region protection (no bosses in spawn), spawn limits, or logging.

## NpcInteractEvent

Fires when a player right-clicks an [NPC](npcs).

**Cancellable:** yes. Cancelling suppresses the NPC's configured right-click effects.

This is the hook for building custom NPC behavior beyond what [right-click effects](creating-an-npc) cover: open a shop inventory, start a dialog tree, gate interactions behind quest progress. Listen, cancel, and run your own logic.

## NMEntitiesReloadedEvent

Fires after `/nme reload` completes: models, mobs, NPCs and effects have all been re-read.

**Cancellable:** no.

Use it to refresh anything your addon derives from NMEntities' registries, like cached mob lists or generated content.

## Listening

Standard Bukkit listeners, nothing special:

```java theme={null}
@EventHandler
public void onNpcInteract(NpcInteractEvent event) {
    // your shop, dialog, quest gate...
}
```

Register the listener in your addon's `onEnable` as usual. The developer guide (`API.md`, shipped with the plugin) covers each event's getters and full examples.
