PocketMine-MP
PocketMine-MP copied to clipboard
Effect won't show up in the player client after cancelling EntityEffectRemoveEvent
Issue description
- Expected result: Effect showing up on player client
- Actual result: Effect wont show up
Steps to reproduce the issue
- add an effect that will expire in few seconds
- cancel EntityEffectRemoveEvent
- profit
OS and versions
- PocketMine-MP: 4.6.0
- PHP: 8.0.16
- Server OS: Windows 10
Plugins
public function onEffectRemove(EntityEffectRemoveEvent $event){
$player = $event->getEntity();
if($player instanceof Player && $player->isConnected()) { //we need to check if the player is connected due to another bug
$event->getEffect()->setDuration(10 * 2);
$event->cancel();
}
}