Why does the timer dont start if i use the command /timer ? https://paste.ee/p/CLsiR Sorry idk how can i put the code here bc its killing your eyes if i copy and paste here
Remove $player and $time from the task constructor, they don't do anything Line 15 PHP: $this->getScheduler()->scheduleRepeatingTask(new Task($this), 20); Line 39 PHP: $this->getPlugin()->getScheduler()->cancelTask($this->getTaskId()); Also PluginTask does not exist anymore, use pocketmine/scheduler/Task instead I recommend you taking a look to the new API
Now i got this error but idk what should i do to fix this Cannot declare class Main\Task because the name is already in use in /home/minecraft/plugins/Task/src/Main/Main.php on line 22 I did this all but yet i got this error and idk what should i do to fix this Cannot declare class Main\Task because the name is already in use in /home/minecraft/plugins/Task/src/Main/Main.php on line 22
Change your task class name or write it like this PHP: class Task extends pocketmine\scheduler\Task { }