Anybody have solution for this error? Im confused with this: Code: 2018-08-30 [08:55:17] [Server thread/CRITICAL]: Could not pass event 'pocketmine\event\player\PlayerJoinEvent' to 'HealthTag v1': Cannot instantiate abstract class pocketmine\scheduler\Task on HealthTag\Main 2018-08-30 [08:55:17] [Server thread/CRITICAL]: Error: "Cannot instantiate abstract class pocketmine\scheduler\Task" (EXCEPTION) in "HealthTag/src/HealthTag/Main" at line 17 2018-08-30 [08:55:17] [Server thread/DEBUG]: #0 src/pocketmine/plugin/MethodEventExecutor(38): HealthTag\Main->onJoin(pocketmine\event\player\PlayerJoinEvent object) 2018-08-30 [08:55:17] [Server thread/DEBUG]: #1 src/pocketmine/plugin/RegisteredListener(98): pocketmine\plugin\MethodEventExecutor->execute(HealthTag\Main object, pocketmine\event\player\PlayerJoinEvent object) 2018-08-30 [08:55:17] [Server thread/DEBUG]: #2 src/pocketmine/plugin/PluginManager(749): pocketmine\plugin\RegisteredListener->callEvent(pocketmine\event\player\PlayerJoinEvent object) 2018-08-30 [08:55:17] [Server thread/DEBUG]: #3 src/pocketmine/Player(1029): pocketmine\plugin\PluginManager->callEvent(pocketmine\event\player\PlayerJoinEvent object) 2018-08-30 [08:55:17] [Server thread/DEBUG]: #4 src/pocketmine/Player(977): pocketmine\Player->doFirstSpawn() 2018-08-30 [08:55:17] [Server thread/DEBUG]: #5 src/pocketmine/level/Level(2464): pocketmine\Player->sendChunk(integer 13, integer 20, pocketmine\network\mcpe\protocol\BatchPacket object) 2018-08-30 [08:55:17] [Server thread/DEBUG]: #6 src/pocketmine/level/Level(2516): pocketmine\level\Level->sendChunkFromCache(integer 13, integer 20) 2018-08-30 [08:55:17] [Server thread/DEBUG]: #7 src/pocketmine/level/format/io/ChunkRequestTask(88): pocketmine\level\Level->chunkRequestCallback(integer 13, integer 20, pocketmine\network\mcpe\protocol\BatchPacket object) 2018-08-30 [08:55:17] [Server thread/DEBUG]: #8 src/pocketmine/scheduler/AsyncPool(285): pocketmine\level\format\io\ChunkRequestTask->onCompletion(pocketmine\Server object) 2018-08-30 [08:55:17] [Server thread/DEBUG]: #9 src/pocketmine/Server(2513): pocketmine\scheduler\AsyncPool->collectTasks() 2018-08-30 [08:55:17] [Server thread/DEBUG]: #10 src/pocketmine/Server(2258): pocketmine\Server->tick() 2018-08-30 [08:55:17] [Server thread/DEBUG]: #11 src/pocketmine/Server(2136): pocketmine\Server->tickProcessor() 2018-08-30 [08:55:17] [Server thread/DEBUG]: #12 src/pocketmine/Server(1713): pocketmine\Server->start() 2018-08-30 [08:55:17] [Server thread/DEBUG]: #13 src/pocketmine/PocketMine(237): pocketmine\Server->__construct(BaseClassLoader object, pocketmine\utils\MainLogger object, string /storage/emulated/0/PocketMine-MP/, string /storage/emulated/0/PocketMine-MP/plugins/) 2018-08-30 [08:55:17] [Server thread/DEBUG]: #14 /storage/emulated/0/PocketMine-MP/PocketMine-MP.phar(1): require(string phar:///storage/emulated/0/PocketMine-MP/PocketMine-MP.phar/src/pocketmine/PocketMine.php) Code: PHP: <?phpnamespace HealthTag;use pocketmine\event\Listener;use pocketmine\event\player\PlayerJoinEvent;use pocketmine\plugin\PluginBase;use pocketmine\scheduler\Task;use pocketmine\scheduler\TaskScheduler;class Main extends PluginBase implements Listener { public function onEnable(){ $this->getLogger()->info("HealthTag Enabled!"); $this->getServer()->getPluginManager()->registerEvents($this, $this); } public function onJoin(PlayerJoinEvent $event){ $player = $event->getPlayer(); $task = new Task($this, $player); $this->getScheduler()->scheduleRepeatingTask($task, 20); }}?>
The task is not completed PHP: <?phpnamespace HealthTag;use pocketmine\Player;use pocketmine\scheduler\Task;class Task extends Task { public function __construct($player){ $this->player = $player; } public function onRun(int $tick){ $health = $this->player->getHealth(); }}?>
Main.php PHP: <?phpnamespace HealthTag;use pocketmine\event\Listener;use pocketmine\event\player\PlayerJoinEvent;use pocketmine\plugin\PluginBase;use pocketmine\scheduler\Task;use pocketmine\scheduler\TaskScheduler;class Main extends PluginBase implements Listener { public function onEnable(){ $this->getLogger()->info("HealthTag Enabled!"); $this->getServer()->getPluginManager()->registerEvents($this, $this); } public function onJoin(PlayerJoinEvent $event){ $player = $event->getPlayer(); $task = new Task($player); $this->getScheduler()->scheduleRepeatingTask($task, 20); }} Task.php PHP: <?phpnamespace HealthTag;use pocketmine\Player;use pocketmine\scheduler\Task as TaskPM;class Task extends TaskPM { public function __construct(Player $player){ $this->player = $player; } public function onRun(int $tick): void{ $health = $this->player->getHealth(); }}