> For the complete documentation index, see [llms.txt](https://syrows-development.gitbook.io/staffmodlib/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://syrows-development.gitbook.io/staffmodlib/other/custom-events.md).

# Custom events

This page is about custom events provided by the library.

### Introduction

With **StaffModLib**, you can use custom events to add behaviors to your staff mods or items. In this page, you we'll learn their usefulness and what they consist of.&#x20;

### Staff mod events

In this section, we'll present all the events related with a staff mod in general. You can see them in the following array:

| Event                  | Description                        |
| ---------------------- | ---------------------------------- |
| `StaffModEnableEvent`  | Called when enabling a staff mod.  |
| `StaffModDisableEvent` | Called when disabling a staff mod. |

### Staff mod item events

In this section, we'll present all the events related with staff mod items. When using other events like `PlayerInteractEvent`, you are not sure that the interaction concerns a staff mod item specifically. By using the events below, you can be sure of that and it make your code easier because you don't have a lot of checks to do.

| Event                  | Description                                                              |
| ---------------------- | ------------------------------------------------------------------------ |
| `ItemUseEvent`         | Called when a player use an item which is not interacting with anything. |
| `ItemUseOnBlockEvent`  | Called when a player use an item on a block.                             |
| `ItemUseOnEntityEvent` | Called when a player use an item on an entity.                           |
