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

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:
    749
  3. xanb

    xanb Spider

    Messages:
    6
    Could anyone show an example maybe?
     
  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.