This is my code : PHP: <?phpnamespace moch\pl; use pocketmine\plugin\PluginBase; use pocketmine\Player; use pocketmine\Server; use pocketmine\event\Listener; use pocketmine\event\player\PlayerJoinEvent; use pocketmine\item\Item; use pocketmine\event\block\BlockPlaceEvent; use pocketmine\event\block\BlockBreakEvent; use pocketmine\block\Block; use pocketmine\utils\Config; use pocketmine\math\Vector3; use pocketmine\level\particle\{DustParticle, FlameParticle, FloatingTextParticle, EntityFlameParticle, CriticalParticle, ExplodeParticle, HeartParticle, LavaParticle, MobSpawnParticle, SplashParticle}; class Main extends PluginBase implements Listener { public $plugin; public function onEnable(){ $this->getLogger()->info("Leaderboard Enable..."); @mkdir($this->getDataFolder() . "Top_Player"); $this->getServer()->getPluginManager()->registerEvents($this, $this); } public function LeadTask(PlayerJoinEvent $event){ $player = $event->getPlayer(); $this->getScheduler()->scheduleDelayedTask(new LeadTask($this, $player), 20); //30min. } public function setfarmdata(BlockBreakEvent $event) { $player = $event->getPlayer(); $name = $player->getName(); $break = $event->getBlock(); if($break->getId() === 141 || $break->getId() === 142 || $break->getId() === 59 || $break->getId() === 86 || $break->getId() === 103){ $data = new Config($this->getDataFolder() . "Top_Player/topfarm.yml", Config::YAML); $up = $data->get($name); $data->set($name, $up + 0.1); $data->save(); } } public function createtopten(PlayerJoinEvent $event){ $player = $event->getPlayer(); $w = $this->getConfig()->get("world"); $world = $player->getLevel()->getName() === "$w"; $top = $this->getConfig()->get("enable"); if($world){ if($top == "true"){ $this->TopFarm($player); } } } public function TopFarm($p){ $player = $p->getPlayer(); $data = new Config($this->getDataFolder() . "Top_Player/topfarm.yml", Config::YAML); $swallet = $data->getAll(); $c = count($swallet); $message = ""; $top = "§b§l=====§eTopFarm§b§l====="; arsort($swallet); $i = 1; foreach ($swallet as $name => $amount) { $message .= "§b ".$i.". §7".$name." §akeep §f".$amount." §aItem\n"; if($i > 9){ break; } ++$i; } $x = $this->getConfig()->get("farm-x"); $y = $this->getConfig()->get("farm-y"); $z = $this->getConfig()->get("farm-x"); $p = new FloatingTextParticle(new Vector3($x, $y + 1, $z), $message, $top); $player->getLevel()->addParticle($p); }}
First of all It's not 30 minute but 1 second .-. Than were is the task class located?? The error is pretty clear