I have an error in my code that I can not solve: HTML: [Server thread/CRITICAL]: Error: "Call to undefined method pocketmine\Server::getScheduler()" (EXCEPTION) in "GunCore v17/src/GunCore/Main" at line 108[m Code : PHP: $this->getServer()->getScheduler()->scheduleRepeatingTask(new ClearLaggTask($this), 12000);
did you search before posting a new thread? https://forums.pmmp.io/threads/pocketmine-server-getscheduler-obsolete.6235/
Replace with: $this->getServer()->getScheduler()->scheduleRepeatingTask(new ClearLaggTask($this), 12000); Change PluginTask to Task on the ClearLaggTask file. And on its constructor, remove parent::__construct(...);
As far as I know, the getServer() function is completely obsolete for normal (not Async) tasks now since all plugins have their own sheduler, so shouldn't it be PHP: $this->getScheduler()->scheduleRepeatingTask(new ClearLaggTask($this), 12000); ?