1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

onRun task not working in this plugin

Discussion in 'Facepalm' started by rektpixel, Aug 7, 2017.

  1. rektpixel

    rektpixel Baby Zombie

    Messages:
    186
    hey I got this CrossOnlineCount plugin and when I run it I get this error:
    Code:
    Fatal error: Declaration of jasonwynn10\CrossOnlineCount\UpdateTask::onRun(int $currentTick) must be compatible with pocketmine\scheduler\Task::onRun($currentTick) in C:\Users\Admin\Creative Cloud Files\Desktop\PymePE\OP Duels - PrymePE\plugins\CrossOnlineCount-master\src\jasonwynn10\CrossOnlineCount\UpdateTask.php on line 0
    [21:38:09] [Server thread/EMERGENCY]: An unrecoverable error has occurred and the server has crashed. Creating a crash dump
    
    This is the UpdateTask file in the plugin:
    PHP:
    <?php
    namespace jasonwynn10\CrossOnlineCount;

    use 
    pocketmine\scheduler\PluginTask;

    class 
    UpdateTask extends PluginTask {
        public function 
    onRun(int $currentTick) {
            
    $this->getOwner()->update();
        }
    }
    How can I fix this?
     
  2. Intyre

    Intyre Administrator Staff Member PMMP Team

    Messages:
    81
    GitHub:
    Intyre
    Fatal error: Declaration of
    Code:
    Task::onRun(int $currentTick)
    must be compatible with
    Code:
    Task::onRun($currentTick)
     
  3. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    You are using an outdated version of PocketMine. Download the latest one from here: https://jenkins.pmmp.io/... or make your plugin compatible with the build you are on.
     
  4. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    read the error
    Code:
    Declaration of jasonwynn10\CrossOnlineCount\UpdateTask::onRun(int $currentTick) must be compatible with pocketmine\scheduler\Task::onRun($currentTick)
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.