Error that i can't understand

Discussion in 'Development' started by mmm545, May 24, 2020 at 1:47 AM.

  1. mmm545

    mmm545 Witch

    Messages:
    68
    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:
    435
    You are missing a use statement for pocketmine\plugin\Plugin
     
    mmm545 likes this.
  3. mmm545

    mmm545 Witch

    Messages:
    68
    GitHub:
    mmm545
    Oopsie doopsie
    I'm an idiot hehe
     

Share This Page

  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.