Enable/Disable Command

Discussion in 'Development' started by xanb, Jul 21, 2021.

  1. xanb

    xanb Spider

    Messages:
    6
    How could I create a command to say disable a text message?
    So far I have:
    Also, how could I add an alias to the command construction?
    PHP:
    public function __construct(){
            
    parent::__construct("chatmessage");
            
    $this->setDescription("Chat Message");
        }
      
        public function 
    execute(CommandSender $senderstring $label, array $args){
            if(
    $sender instanceof Player){
                
    $sender->sendMessage("You have [disable/enabled-here] command");
    for aliases, would i do:
    PHP:
    $this->setDescription("desc");
    $this->setAliases(["alias"]);
    ?
     
  2. Primus

    Primus Zombie Pigman

    Messages:
    680
  3. xanb

    xanb Spider

    Messages:
    6
    Could anyone show an example maybe?
     

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.