[Solved] Code keeps getting messed up on commands

Discussion in 'Plugin Development' started by FTWin01Gurl, Jun 23, 2012.

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

    FTWin01Gurl

    This issue has stumped me for hours now and I haven't found a solution.

    Code:java
    1.  
    2. } else if(args.length == 3) {
    3. else if(args[0].equalsIgnoreCase("set")) {
    4. //Do stuff
    5. }
    6. } else if(args.length == 4) {
    7.  

    This code returns an error (which is the first stating curly bracket starting a new statement) which means it requires a closing bracket. However, I've tried to correct my code and it messes up the command. How would I go fixing this dilemma?

    EDIT: I have the code, only censored. http://pastebin.com/kPG0w1Kh
     
  2. Offline

    Tog

    The problem is most likely that you have an else if inside the curly brackets, but no if preceding that else if(if that makes any sense).

    Code:
     else if(args.length == 3) {
    ***THIS ONE RIGHT HERE***else if(args[0].equalsIgnoreCase("set")) {
    //Do stuff
    }
    } else if(args.length == 4) {
    
     
  3. Offline

    Firefly

    You need a closing bracket after the last return false

    That too :p

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 26, 2016
  4. Offline

    FTWin01Gurl

Thread Status:
Not open for further replies.

Share This Page