How to preform a command as the console

Discussion in 'Plugin Development' started by cheese5505, Jan 12, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    cheese5505

    How do you/Is it possible to preform a command as the console?
     
  2. Offline

    desht

    PHP:
    String command "your command here";   // without the leading '/'
    boolean ok Bukkit.dispatchCommand(Bukkit.getConsoleSender(), command);
    if (!
    ok) {
      
    // failed to run the command
    }
     
  3. Offline

    cheese5505

    Thanks.
     
Thread Status:
Not open for further replies.

Share This Page