Solved Variable marked as unused, yet it is used under it

Discussion in 'Plugin Development' started by SpongyBacon, Mar 24, 2014.

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

    SpongyBacon

    Hey Bukkit :3
    So i've been making a plugin, and in this method one of the variables (int xp123 = Constitution.getXP(p)) the variable is marked as unused, yet directly below it, xp123 is used.

    Quite note, it's called xp123 to ensure that it is the only variable with the name in the entire plugin.

    My code:
    Code:java
    1. Removed by self

    I haven't tried to compile it yet, but I doubt it will compile.

    The Constitution.getXP(Player p) method incase needed:
    Code:java
    1. Removed by self
     
  2. Offline

    Booshayy

    I'm pretty sure this is just supposed to be:
    Code:java
    1. xp123 + finalDamage;
     
  3. Offline

    Techy4198

    SpongyBacon you're actually doing nothing with it other than adding a number anyway. use it after that and it might work. what is supposed to happen? is it supposed to save xp123 to the config?

    Booshayy wrong. get your facts right m8.
     
  4. Offline

    SpongyBacon

    Booshayy Doesn't work - I get "Syntax error on token "+", invalid
    AssignmentOperator"

    Techy4198 Well, it's supposed to get the Constitution xp level, and then add the amount of damage caused onto the xp level, and save that in the config in the place of the old xp level.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  5. Offline

    Techy4198

    SpongyBacon well why aren't you actually saving it to the config then? search for bukkit configuration tutorials on google.
     
  6. Offline

    SpongyBacon

    Solved. Once again, SpongyBacon makes a dumb thread for a simple thing >_>
     
Thread Status:
Not open for further replies.

Share This Page