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

Solved Unregister Command not working

Discussion in 'Development' started by xXNiceAssassinlo YT, Jan 21, 2018.

  1. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    PHP:
    public function __construct(BaseAPI $apistring $namestring $description ""string $usageMessage ""$consoleUsageMessage true, array $aliases = []){
    parent::__construct($api$name$description$usageMessage$consoleUsageMessage$aliases);
    // Special part :D
    $commandMap $api->getServer()->getCommandMap();
    $command $commandMap->getCommand($name);
    $command->setLabel($name "_disabled");
    $command->unregister($commandMap);
    }
    Error:
    PHP:
    Error"Call to a member function setLabel() on null" (EXCEPTIONin "plugins/EssentialsPE-master/src/EssentialsPE/Commands/Override/BaseOverrideCommand" at line 24
    Line 24:
    PHP:
    $command->setLabel($name "_disabled");
     
  2. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    This means the original command was not registered.
     
  3. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    Oh okay thx
     
  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.