The code below should check if a player is in an arena before killing the player. PHP: /*** @param EntityDamageEvent $event*/public function catchDamage(EntityDamageEvent $event){ if ($event->getEntity() instanceof Player) { if ($event instanceof EntityDamageByEntityEvent) { $player = $event->getEntity(); if ($this->getPlugin()->getRegion(1)->isInAnyArena($player)) { /* Kill Player */ } } } } Get the class: PHP: public function getRegion(int $id){ $regions = [ new SpawnRegion(), new ArenaRegion() ]; return ($id > -1 && $id <= count($regions)) ? $regions[$id] : echo 'lol class not found: '.$id.'. dafuq :/';} Check if the player is in the arena(s): PHP: class ArenaRegion{ private $y = [0, 255]; /** * @param Player $player * @return bool */ public function isInAnyArena(Player $player) : bool { if ($this->inDragon($player) || $this->inForest($player) || $this->inIce($player) || $this->inSteamPunk($player)) { return true; } return false; } /** * @param Player $player * @return bool */ public function inIce(Player $player) : bool { $x = [211, 149]; $z = [214, 294]; $axis = new AxisAlignedBB(min($x), max($x), min($this->y), max($this->y), min($z), max($z)); if ($axis->isVectorInside($player)) { return true; } return false; } /** * @param Player $player * @return bool */ public function inDragon(Player $player): bool { $x = [216,287]; $z = [301,358]; $axis = new AxisAlignedBB(min($x), max($x), min($this->y), max($this->y), min($z), max($z)); if ($axis->isVectorInside($player)) { return true; } return false; } /** * @param Player $player * @return bool */ public function inSteamPunk(Player $player) : bool { $x = [301,213]; $z = [216,161]; $axis = new AxisAlignedBB(min($x), max($x), min($this->y), max($this->y), min($z), max($z)); if ($axis->isVectorInside($player)) { return true; } return false; } /** * @param Player $player * @return bool */ public function inForest(Player $player) : bool { $x = [301,360]; $z = [288,228]; $axis = new AxisAlignedBB(min($x), max($x), min($this->y), max($this->y), min($z), max($z)); if ($axis->isVectorInside($player)) { return true; } return false; } The coordinates fed are accurate, there are no console errors. It's just the method call. Thanks for your help.
Did you debug this code yourself already? PHP: if ($this->getPlugin()->getRegion(1)->isInAnyArena($player)) { echo "ArenaRegion::isInAnyArena($player->getName()) returned true \n";} else { echo "ArenaRegion::isInAnyArena($player->getName()) returned false \n";} Then find out return values of the checks PHP: var_dump($this->inDragon($player), $this->inForest($player), $this->inIce($player), $this->inSteamPunk($player)) Alternatively you can use debugger from IDE and avoid this all.