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

Fatal error Declaration

Discussion in 'Facepalm' started by CupidonSauce173, Feb 23, 2018.

  1. CupidonSauce173

    CupidonSauce173 Zombie

    Messages:
    298
    GitHub:
    cupidonsauce173
    Hi, I am having issues with my plugins and I can't figure out why it crash, here is the crash dump :

    Error: Declaration of CupidonSauce173\BouncyBlocks\BouncyBlocks::eek:nCommand(pocketmine\command\CommandSender $sender, pocketmine\command\Command $command, $label, array $args) must be compatible with pocketmine\plugin\PluginBase::eek:nCommand(pocketmine\command\CommandSender $sender, pocketmine\command\Command $command, string $label, array $args): bool
    File: BouncyBlocks_v1.1.phar/src/CupidonSauce173BouncyBlocks/BouncyBlocks
    Line: 14
    Type: E_COMPILE_ERROR
    THIS CRASH WAS CAUSED BY A PLUGIN

    Code:
    [5] use pocketmine\command\Command;
    [6] use pocketmine\command\CommandSender;
    [7] use pocketmine\event\entity\EntityDamageEvent;
    [8] use pocketmine\event\player\PlayerMoveEvent;
    [9] use pocketmine\event\Listener;
    [10] use pocketmine\math\Vector3;
    [11] use pocketmine\Player;
    [12] use pocketmine\plugin\PluginBase;
    [13]
    [14] class BouncyBlocks extends PluginBase implements Listener{
    [15]
    [16] private $max;
    [17] private $blocks;
    [18]
    [19] public $fall;
    [20] public $bounceVelocity;
    [21] public $disabled;
    [22]
    [23] public function onEnable(){
    [24] $this->getServer()->getPluginManager()->registerEvents($this, $this);

    Backtrace:

    PocketMine-MP version: 1.7dev #731 [Protocol 201; API 3.0.0-ALPHA11]
    Git commit: 7dd834bca004241a3a4ab812edd6fb7053b27bd9
    uname -a: Linux b1.cryoservers.com 3.10.0-693.11.6.el7.x86_64 #1 SMP Thu Jan 4 01:06:37 UTC 2018 x86_64
    PHP Version: 7.2.1
    Zend version: 3.2.0
    OS : Linux, linux

    Here is the code of my main :

    <?php

    namespace cupidonsauce173\BouncyBlocks;

    use pocketmine\command\Command;
    use pocketmine\command\CommandSender;
    use pocketmine\event\entity\EntityDamageEvent;
    use pocketmine\event\player\PlayerMoveEvent;
    use pocketmine\event\Listener;
    use pocketmine\math\Vector3;
    use pocketmine\Player;
    use pocketmine\plugin\PluginBase;

    class BouncyBlocks extends PluginBase implements Listener
    {

    private $max;
    private $blocks;

    public $fall;
    public $bounceVelocity;
    public $disabled;

    public function onEnable(){
    $this->getServer()->getPluginManager()->registerEvents($this,$this);
    $this->saveDefaultConfig();

    $config = $this->getConfig();
    $this->max = $config->get("max");
    $this->blocks = $config->get("blocks");
    $this->fall = new \SplObjectStorage();
    $this->bounceVelocity = new \SplObjectStorage();
    $this->disabled = new \SplObjectStorage();

    }


    Someone can help me ?
     
    Last edited: Feb 23, 2018
  2. CupidonSauce173

    CupidonSauce173 Zombie

    Messages:
    298
    GitHub:
    cupidonsauce173
    I just put the part of the code where they say that there is a error
     
  3. CupidonSauce173

    CupidonSauce173 Zombie

    Messages:
    298
    GitHub:
    cupidonsauce173
    Nvm, find the problem lol, forgot to add strings
     
  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.