It just doesn't work, no error either, i did register all event/listener PHP: if($event instanceof EntityDamageByEntityEvent){ $e = $event->getEntity(); $d = $event->getDamager(); if ($e instanceof Player && $d instanceof Player) { if($e->hasEffect(Effect::INVISIBILITY)) { $e->removeEffect(Effect::INVISIBILITY); } if($d->hasEffect(Effect::INVISIBILITY)) { $d->removeEffect(Effect::INVISIBILITY); } } } Any help would be greatly appreciate
The code seems to be correct, but I would try updating two things. 1. removeEffect() already checks if the player has the effect, there's no need of checking it again. 2. Call the EntityDamageByEntityEvent event directly on the listener, again, there's no need of checking if EntityDamageEvent is an instance of it.