Solved Checking for multiple commands?

Discussion in 'Plugin Development' started by klosjaarrr, Jun 7, 2014.

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


    Hey all,

    I'm writing a small plugin with 2 commands, being /title and /titles. Now I need to check if the command is executed, but the following code does not work:

    1. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    3. if (!cmd.getName().equalsIgnoreCase("title") || !cmd.getName().equalsIgnoreCase("titles")) {
    4. // Sending error
    5. return false;
    6. }
    8. // Executing code
    9. return true;
    10. }

    Is there a way to check for 2 commands in 1 onCommand() method? Or how would I be able to do this?
  2. Offline


    There is an option in the plugin.yml called aliasses, use that. Then set-up a seperate commandExecutor for the command 'title', and set an alias 'titles'.
    klosjaarrr likes this.
  3. Offline


    That works, thanks :)
Thread Status:
Not open for further replies.

Share This Page