So i have this code PHP: public function onQuit(PlayerQuitEvent $e) { $player = $e->getPlayer(); $task = $this->tasks[$player->getId()]; unset($this->tasks[$player->getId()]); $task->getHandler()->cancel(); }} When i started server, it sent this error Code: 2018-12-31 [02:17:43] [Server thread/INFO]: MrDinoDuck joined the game 2018-12-31 [02:19:35] [Server thread/CRITICAL]: ErrorException: "Undefined offset: 1" (EXCEPTION) in "Wings-1/src/Wings/Main" at line 160 2018-12-31 [02:20:22] [Server thread/CRITICAL]: ErrorException: "Undefined offset: 2" (EXCEPTION) in "Wings-1/src/Wings/Main" at line 160 It make me cant join the server
That code you posted should only be executed when the player exits the game, and since your error happens when a player joins, it makes sense that your code snippet isn't related to the problem. Do you have an event handler for players joining, and if so, can we see that? If you are decent at troubleshooting and research, you may be able to resolve this yourself. Your problem isn't a pocketmine-related issue, it's a php error. Thankfully, it's common enough that there are plenty of explanations on why it occurs and how to fix it. This should help.