PocketMine-MP
PocketMine-MP copied to clipboard
PlayerExhaustEvent: misunderstood of getPlayer method
Issue description
PlayerExhaustEvent may misunderstood to player's hunger exhaust, and the method getPlayer is confused because it may return a non-player object if using a custom human.
https://github.com/pmmp/PocketMine-MP/blob/c87a3b054cf29282464f50b6234638b2bbe665ab/src/event/player/PlayerExhaustEvent.php#L32
player's event not only called for player, but also for custom human
Yeah, one of my plugins just crashed because of this