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

Error that i can't understand

Discussion in 'Development' started by mmm545, May 24, 2020.

  1. mmm545

    mmm545 Baby Zombie

    Messages:
    152
    GitHub:
    mmm545
    i followed this tutorial https://forums.pmmp.io/threads/plugin-command-v2.9320/#post-70597
    and here is my code:
    PHP:
    class GetUUID extends Command implements PluginIdentifiableCommand{

        
    /**
         * @var Plugin
         */

            
    public function __construct(string $namePlugin $pluginstring $description "", ?string $usageMessage null, array $aliases = []){
                
    parent::__construct($name$description$usageMessage$aliases);
                
    $this->plugin $plugin;
                
    $this->setDescription("Get a player's UUID");
            }

            public function 
    execute(CommandSender $senderstring $commandLabel, array $args){
               
            }

            public function 
    getPlugin(): Plugin{
                return 
    $this->plugin;
            }
    but it gives me this error
    Code:
    Fatal error: Declaration of mmm545\UUIDBan\Commands\GetUUID::getPlugin(): mmm545\UUIDBan\Commands\Plugin must be compatible with pocketmine\command\PluginIdentifiableCommand::getPlugin(): pocketmine\plugin\Plugin in C:\Users\hehe\Desktop\pocketmine\plugins\UUID Ban\src\mmm545\UUIDBan\Commands\GetUUID.php on line 13
    
    i feel it's a stupid mistake
     
  2. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
    You are missing a use statement for pocketmine\plugin\Plugin
     
    mmm545 likes this.
  3. mmm545

    mmm545 Baby Zombie

    Messages:
    152
    GitHub:
    mmm545
    thx
     
    Last edited: Oct 1, 2020
  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.