Solved [HELP] Undefined argument error

Discussion in 'Plugin Development' started by CreepahMC, Apr 11, 2014.

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

    CreepahMC

    Not sure what area in this method is wrong.

    Code:java
    1. public void playEffect(Location location, Effect effect, boolean v) {
    2. for (int i = 0; i <= 8; i += ((!v && (i = 3)) ? 2 : 1))
    3. location.getWorld().playEffect(location, effect, i);
    4. }


    Anyone have a clue on a fix for this?

    Error: The operator && is undefined for the argument type(s) boolean, int

    EDIT: To be more specific...

    Line of error:
    Code:java
    1. for (int i = 0; i <= 8; i += ((!v && (i = 3)) ? 2 : 1))


    Error in line above:
    Code:java
    1. ((!v && (i = 3))


    Not sure what to change in this line to resolve error or if it even is a worry. Haven't tested plugin fyi. Should I run the plugin, see if there's no errors, and see if the error consists in the console, then ignore it, or attempt to fix?
     
  2. Offline

    St3venAU

    i think you may want (i == 3) instead of (i = 3)
     
  3. Offline

    CreepahMC

    Wow, dumb of me. Thanks for the help bud.
     
Thread Status:
Not open for further replies.

Share This Page