PHP: public function onDeath(PlayerDeathEvent $ev){ $victim = $ev->getEntity(); $ev->setDeathMessage(null); if($victim instanceof Player){ $player = $victim; $cause = $player->getLastDamageCause(); if($cause instanceof EntityDamageByEntityEvent){ $killer = $cause->getDamager(); if(!$this->getPlugin()->isInMatch($killer)) return; $match = $this->getPlugin()->getMatch($killer); $match->removePlayer($player); $this->getPlugin()->win($killer); } } } When ever a player dies and they are in a match it dosent seem to call the event(it wont remove the player that died or call the win function)
Always have and always will i know they added "getPlayer()" but it's more of a natural reaction to type "getEntity()"
Debug it. You can't really expect us to help when we don't understand how the methods you're using work. I suppose that the isInMatch method is returning false and you use return after that so it stopped. But I actually have no clue. tl;dr echo the values of the methods you are using in the if statements and see which wrongs should be different.