Int with bukkit

Discussion in 'Plugin Development' started by gban, Dec 18, 2016.

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

    gban

    I can't seem to find out why this doesnt work

    im using 1.7.10 paper spigot

    Code:
                        Player[] arrayOfPlayer;
                        int j = (arrayOfPlayer = Bukkit.getServer().getOnlinePlayers()).length;
                        for (int i = 0; i < j; i++) {
                            Player localPlayer1 = arrayOfPlayer[i];
                        }
     
  2. Offline

    timtower Administrator Administrator Moderator

    @gban Split the lines
    And define "doesn't work"
     
  3. Offline

    Lordloss

    You are trying to set a value to 2 different objects in a single line which cant be.
    Seems like you want to iterate the players online, please look into the enhanced for-loop.
     
Thread Status:
Not open for further replies.

Share This Page