Hi PM, im trying to cancel a task with PHP: public function cancel(){ $this->getHandler()->cancel(); } But crash the server Task code: PHP: public function onRun($currentTick) { $this->startTime--; if ($this->plugin->getPlayersInGame() != null) { if ($this->status === self::WAITING){ $this->plugin->getPlayersInGame()->sendTip($this->plugin->useColor("&eIniciando en &a" . $this->startTime . "&e segundos.")); } switch ($this->startTime) { case 0: $this->plugin->getPlayersInGame()->getInventory()->clearAll(); $this->plugin->startGame(); $this->status = self::PLAYING; $this->cancel(); // This is line 43 break; } } } any suggestion?? :c
If you are in a task(extend PluginTask) you can just do $this->cancel() without adding the cancel() function