investmentideas Posted March 22, 2019 Share Posted March 22, 2019 Hi, I am trying to code this bot to attack a player if it comes within a radius of 5 tiles and the player is not one of the following names ("User1", "User2"). I have this below code but not sure where to go. any advice on how I can check based on player usernames? players.getAll().stream().anyMatch(f -> myPlayer().getArea(5).contains(f)); Quote Link to comment Share on other sites More sharing options...
HeyImJamie Posted March 22, 2019 Share Posted March 22, 2019 Does f not have a getName option? !f.equals("name") Quote Link to comment Share on other sites More sharing options...
Naked Posted March 22, 2019 Share Posted March 22, 2019 (edited) Filter<Player> playerFilter = player -> myPlayer().getArea(5).contains(player) && player.isVisible() && !playerNames.contains(player.getName()); Edited March 22, 2019 by Naked Quote Link to comment Share on other sites More sharing options...