Solved ArrayIndexOutOfBounds

Discussion in 'Plugin Development' started by PumpMelon, Sep 25, 2016.

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

    PumpMelon

    Hello,
    Whenever someone types /honour (by itself) it gives an internal error with an ArrayIndexOutOfBounds.

    I don't know why this is happening, it doesn't affect anything though it's just annoying.
    http://pastebin.com/e5xXiWFx



    The error is on the line if(args[0].equalsIgnoreCase("remove") line.

    Any help would be appreciated!
     
  2. Offline

    Whoneedspacee

    Didn't you already make a thread with this? Also, I'm confused, you're code is formatted weird but I'm pretty sure that line shouldn't even be running when you only type /honour since there's a check to see if the args length is equal to 3.

    Code:
      if(args.length == 3)
        {
            if(args[0].equalsIgnoreCase("remove") && sender.hasPermission("honour.remove"))
            {
                if(args.length != 3)
                {
    Not sure what you're trying to do here or why that's there, I can't help you.
     
  3. Offline

    Tecno_Wizard

    @PumpMelon please repost the code with it correctly indented (eclipse or intellij, run auto-indent). Post it again with the entire class, and post the full stack trace. I can't tell what's wrong by what you gave us.
     
  4. Offline

    PumpMelon

    Found the solution,

    thanks.
     
Thread Status:
Not open for further replies.

Share This Page