Hello. I have there code. When player touch sign: PHP: if($x == 257 && $y == 63 && $y == 275){ $e->setCancelled(); $this->joinArena($p, "Pizza", $arX, $arY, $arZ); } And PHP: public function joinArena(Player $player, $arena, $x,$y, $z){ array_push($this->players[$arena], $player->getName()); $player->teleport(new Position($x, $y, $z, $this->getServer()->getLevelByName($arena)));} But when I touch, nothink happens.
How is this relevant to array_push? What are $x, $y, $z, $arX, $arY, $arZ, $p, etc.? Do you get any errors? Is joinArena() being called correctly?
Yes, this function is correctly maked. I tried same without function (array_push in PlayerInteractEvent), but it didn't added player to array. No, there aren't any errors in console
array_push wouldn't cause nothing to happen. Try debugging to see if joinArena is being called. Something like this would work: PHP: //Assuming your class extends PluginBase:$this->getLogger()->notice("joinArena run"); I still know absolutely nothing about what $p, $x, $y, or $z are, or how your listener is set up.