Validates event handler methods to ensure they are properly configured and follow PocketMine-MP conventions
The event handler analyzer validates event handler methods in your plugin to ensure they follow PocketMine-MP’s event system requirements and best practices.
Event handlers must accept exactly one parameter: the event object.Incorrect:
public function onPlayerChat(PlayerChatEvent $event, string $extra): void { // Too many parameters}public function onPlayerMove(): void { // Missing event parameter}
Correct:
public function onPlayerChat(PlayerChatEvent $event): void { // Exactly one parameter}
The analyzer flags when @handleCancelled is used to ensure it’s intentional.
/** * @handleCancelled true */public function onBlockPlace(BlockPlaceEvent $event): void { // This will run even if the event is cancelled // Make sure this is what you want}
Common use cases for @handleCancelled
Logging all attempts (even cancelled ones)
Cleaning up resources regardless of event outcome
Monitoring plugin compatibility issues
In most cases, you should NOT use @handleCancelled.