An open API service indexing awesome lists of open source software.

https://github.com/scarletredman/cooleventlistener

The syntax sugar library for registration events listeners
https://github.com/scarletredman/cooleventlistener

pmmp pmmp-4 pmmp-plugin pocketmine

Last synced: 5 months ago
JSON representation

The syntax sugar library for registration events listeners

Awesome Lists containing this project

README

          

# CoolEventListener
The library for creation cool events listeners with attributes.
This is a syntax sugar.

## Using
Event listener:
```php
getPlayer()->sendMessage("Hello dude :P");
}

#[EventHandler(priority: EventPriority::HIGH)]
private function onChat1(PlayerChatEvent $event): void {
$event->getPlayer()->sendMessage("A event with high priority");
}

#[EventHandler(priority: EventPriority::LOW)]
private function onChat2(PlayerChatEvent $event): void {
$event->getPlayer()->sendMessage("A event with low priority");
}
}
```
Plugin:
```php