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
- Host: GitHub
- URL: https://github.com/scarletredman/cooleventlistener
- Owner: ScarletRedMan
- Created: 2022-05-19T06:08:05.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-19T06:14:50.000Z (about 4 years ago)
- Last Synced: 2024-12-20T03:32:38.590Z (over 1 year ago)
- Topics: pmmp, pmmp-4, pmmp-plugin, pocketmine
- Language: PHP
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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