getDescription() public method

public getDescription ( ) : string
return string
Example #1
0
 public function onCommand(CommandSender $sender, Command $command, $label, array $args)
 {
     switch ($command->getName()) {
         case "l":
             if ($sender instanceof Player) {
                 if (count($args) === 0) {
                     $sender->sendMessage($command->getDescription());
                     return true;
                 } else {
                     $subcmd = array_shift($args);
                     switch ($subcmd) {
                         case "marry":
                             return $this->marryCommand($sender, $args);
                             break;
                         case "divorce":
                             return $this->divorceCommand($sender, $args);
                             break;
                         case "msg":
                             return $this->msgCommand($sender, $args);
                             break;
                         case "tp":
                             return $this->tpCommand($sender, $args);
                             break;
                         case "who":
                             return $this->whoCommand($sender, $args);
                             break;
                         case "yes":
                             return $this->yesCommand($sender, $args);
                             break;
                         case "no":
                             return $this->noCommand($sender, $args);
                             break;
                         case "help":
                             return $this->helpCommand($sender, $args);
                             break;
                         default:
                             return false;
                             break;
                     }
                 }
             } else {
                 $sender->sendMessage(TextFormat::RED . "This command only works in-game.");
                 return true;
             }
             break;
     }
     return false;
 }