pocketmine\plugin\PluginBase::getCommand PHP Method

getCommand() public method

public getCommand ( string $name ) : Command | pocketmine\command\PluginIdentifiableCommand
$name string
return pocketmine\command\Command | pocketmine\command\PluginIdentifiableCommand
    public function getCommand($name)
    {
        $command = $this->getServer()->getPluginCommand($name);
        if ($command === null or $command->getPlugin() !== $this) {
            $command = $this->getServer()->getPluginCommand(strtolower($this->description->getName()) . ":" . $name);
        }
        if ($command instanceof PluginIdentifiableCommand and $command->getPlugin() === $this) {
            return $command;
        } else {
            return null;
        }
    }