PocketMine-MP icon indicating copy to clipboard operation
PocketMine-MP copied to clipboard

Effect won't show up in the player client after cancelling EntityEffectRemoveEvent

Open UnknownOre opened this issue 2 years ago • 0 comments

Issue description

  • Expected result: Effect showing up on player client
  • Actual result: Effect wont show up

Steps to reproduce the issue

  1. add an effect that will expire in few seconds
  2. cancel EntityEffectRemoveEvent
  3. 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();
		}
}

UnknownOre avatar Jul 13 '22 11:07 UnknownOre