Solved Why does it keep trying to make me initialize main variable

Discussion in 'Plugin Development' started by nrs23, Dec 28, 2013.

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

    nrs23

    Fairly self explanatory

    What is wrong with this code/why does it keep telling me to initialize to main variable

    Code:java
    1. public static void DamagePlayer()
    2. {
    3. Main main; //this is the variable it keeps telling me to initialize.
    4. for(String frozen : main.freeze){
    5. Player player = Bukkit.getPlayerExact(frozen);
    6. player.damage(2.0);
    7. if (player.getHealth() == 1) {
    8. player.sendMessage(ChatColor.BLUE + "So Cold... So Cold... So.. So.. So Very Cold........");
    9. Cold(player);
    10. }
    11. }
    12. }
     
  2. Offline

    AoH_Ruthless

    nrs23 because you have to initialize it ... fairly straightforward.
     
  3. Offline

    xTigerRebornx

    nrs23 You can't access an object if its never made, can you?
     
  4. Offline

    nrs23

Thread Status:
Not open for further replies.

Share This Page