Run 2 for loops after another


I want to run 2 loops after each other, but it doesn't give me the second log message which is p.sendMessage() because it stops by the 1st loop. I have already tried some things like different methods, but I need the lists. Can anybody help me with this?

        String arenaname = game.players.get(p.getUniqueId());
        ArrayList<UUID> listofplayer = new ArrayList<UUID>();
        for (Entry<UUID, String> entry : game.players.entrySet()) {
        for(int i=0; i==listofplayer.size()+1; i++){
            UUID uuid = listofplayer.get(i);
            for(Player player : Bukkit.getServer().getOnlinePlayers()){
                    World world = Bukkit.getWorld(main.arenas.getString("arenas." + arenaname + "." + i+1 + ".world"));

                    Location loc = new Location(world, main.arenas.getDouble("arenas." + arenaname + "." + i+1 + ".X")
                            , main.arenas.getDouble("arenas." + arenaname + "." + i+1 + ".Y")
                            , main.arenas.getDouble("arenas." + arenaname + "." + i+1 + ".Z"));

It never enters the second loop. You have i==listofplayer.size()+1 as the condition. I doubt that is what you meant, and since you set i=0, this will never be true. You probably want i < listofplayer.size(). That will allow your loop to loop through each player in listofplayer.

for(int i=0; i < listofplayer.size(); i++){

Notice that I removed the +1 at the end of listofplayer.size() as well. This is because including that would lead to an IndexOutOfBounds exception, because the last iteration of the loop would attempt to access an index in the array that doesn't exist. Arrays are 0 indexed, so the last index is always 1 less than the length of the array.