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

Code Error

Discussion in 'Facepalm' started by XxCodeRedxX, Aug 25, 2017.

Thread Status:
Not open for further replies.
  1. XxCodeRedxX

    XxCodeRedxX Witch

    Messages:
    68
    Can anyone help me with this error?

    Error: Declaration of UHCReload\Countdown::eek:nRun(int $currentTick) must be compatible with pocketmine\scheduler\Task::eek:nRun($currentTick)
    File: /plugins/UHCReload_v1/src/UHCReload/Countdown
    Line: 19
    Type: E_COMPILE_ERROR

    THIS CRASH WAS CAUSED BY A PLUGIN
    BAD PLUGIN : UHCReload v1

    Code:
    [10] use pocketmine\level\Level;
    [11] use pocketmine\utils\Config;
    [12] use pocketmine\math\vector3;
    [13] use UHCReload\Main;
    [14] use pocketmine\Player;
    [15] use pocketmine\level\sound\GhastSound;
    [16] use pocketmine\level\sound\ClickSound;
    [17] use pocketmine\level\sound\AnvilUseSound;
    [18]
    [19] class Countdown extends PluginTask {
    [20] private $countdown = 0;
    [21] public function __construct(Main $plugin) {
    [22] parent::__construct($plugin);
    [23] }
    [24] public function onRun(int $currentTick) {
    [25] if(!isset($this->countdown)) {
    [26] $this->countdown = $currentTick;
    [27] }
    [28] $time = $currentTick - $this->countdown; // in ticks
    [29] $online = count($this->getOwner()->getServer()->getOnlinePlayers());
     
  2. WinterBuild7074

    WinterBuild7074 Zombie Pigman

    Messages:
    693
    GitHub:
    winterbuild7074
    Remove the int from onRun(int $currentTick)on line 24.
     
  3. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    cAn aNYoNe hElP mE wItH tHis eRrOr I gOt bY blIndly uPdAtinG mY pOckEtMiNe
     
  4. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    You are using an outdated version of PocketMine.
     
Thread Status:
Not open for further replies.
  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.