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

Excute default commands ?

Discussion in 'Development' started by GOdly, Jan 24, 2017.

  1. GOdly

    GOdly Witch

    Messages:
    50
    GitHub:
    CentOsDogE
    code to excute default command in another plugin ?
     
  2. kaliiks

    kaliiks Zombie

    Messages:
    250
    PHP:
    $cmd = array("YourCommand1""YourCommand2");
    $this->getServer()->dispatchCommand(new ConsoleCommandSender(), $cmd[0]));
     
    GOdly likes this.
  3. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Why the array?
     
  4. GOdly

    GOdly Witch

    Messages:
    50
    GitHub:
    CentOsDogE
    another solution ?
     
  5. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    PHP:
    $this->getServer()->dispatchCommand(new ConsoleCommandSender(), "command");
     
  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.