for ( temp.pl : allplayers ) { //This will get you all the current players on the server. if (temp.pl.level.name != player.level.name) { //And this will filter out the players that aren't in your level. continue; } echo( temp.pl );}