Solved Checking empty argument bug

Discussion in 'Plugin Development' started by Aragone, Jul 10, 2019.

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



    I would like to check if the argument <player_name> is empty in the command /troc start <player_name>. I tried that but it doesn't work. Also, I tried args[1].equals(null) == true, !args[1].equals(null) == false, but nothing is running.

    When I put an argument as a player name, the plugin run well. But when I put nothing, I have an error message.


    Thanks for you help.

    Code :
  2. Online

    timtower Moderator Moderator

    @Aragone An argument is never empty.
    But you are not checking if the args length ==2 there.
  3. Offline


    Oh pfff yes I undertand x) That was very simple...
    timtower likes this.
Thread Status:
Not open for further replies.

Share This Page