> For the complete documentation index, see [llms.txt](https://wiki.ericlmao.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.ericlmao.com/projects/alumina/events-subscriber.md).

# Events Subscriber

This utility allows you to statically and dynamically subscribe, listen, and react to events.

<details>

<summary>Example</summary>

```java
public class ExamplePlugin extends AluminaPlugin {

    @Override
    public void load() {

    }

    @Override
    public void enable() {
        Events.listen(PlayerJoinEvent.class, event -> {
            Player player = event.getPlayer();
            
            player.sendMessage(Component.text("Welcome to the server! :)").color(NamedTextColor.GREEN));
        });
    }

    @Override
    public void disable() {

    }

}
```

</details>
