-1

I just created a plugin that enables donors to vote on weather and time, there were no errors showing up in my IDE (Eclipse), but when I try to run it on my plugin test server, it gives CommandException, and I can't figure out what its problem is.

Here is my code:

http://pastebin.com/ksbfRDfT

Here is the Exception:

http://pastebin.com/fiKb4Vz3

I do need to hurry, because I am doing this for VoxelMC, and it needs to be done quick.

EDIT: The first command (startvote) is working now, however the second command is giving the same exception now. Am I not seeing something? I changed the old link to code to a new link to the code.

  • 1
    Paste your code *here* and provide a minimal example. Arrays are zero based, use `args[0]` to access the first element. – Andrew Li Jul 17 '16 at 19:45

1 Answers1

1

Bukkit commands work as follows:

/command args[0] args[1] args[2] args[3] args[4] args[5]

The exception is caused because you're using args[1], which corresponds to the second parameter in the command you typed in. You're most likely looking for args[0].

Another thing, you're using the == operator for String comparison, you should use String.equals(String);

Elite_Dragon1337
  • 348
  • 2
  • 13