Solved ■ Remove command args (getMessage) ■

Discussion in 'Plugin Development' started by mineart.at, Feb 24, 2013.

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

    mineart.at

    Code:
    public void onPreprocess(PlayerCommandPreprocessEvent event) {
        String command = event.getMessage();
                    if (command .equalsIgnoreCase("/something")) { ...
    ... works as long as the player does not type /something with arguments
    How do I remove arguments from the message? command.startsWith() is not possible in this case.
     
  2. Offline

    Tirelessly

    String[] splitted = command.split(" ");
    if(splitted[0].equalsIgnoreCase("/something"))...
     
  3. Offline

    mineart.at

    Thank you!
     
Thread Status:
Not open for further replies.

Share This Page