mlrkey Posted May 24, 2015 Share Posted May 24, 2015 (edited) how is this done again? thanks guys Edited May 24, 2015 by mlrkey Quote Link to comment Share on other sites More sharing options...
Czar Posted May 24, 2015 Share Posted May 24, 2015 Player p = getPlayers().closest(playerName); // .. p.interact("Attack"); make sure to add the necessary checks, I'm only showing the core process. It's the same as any other <code>Entity</code> Quote Link to comment Share on other sites More sharing options...
mlrkey Posted May 24, 2015 Author Share Posted May 24, 2015 Player p = getPlayers().closest(playerName); // .. p.interact("Attack"); make sure to add the necessary checks, I'm only showing the core process. It's the same as any other <code>Entity</code> Any way to get the closest player without looking at name? Quote Link to comment Share on other sites More sharing options...
Mysteryy Posted May 24, 2015 Share Posted May 24, 2015 Any way to get the closest player without looking at name? Get all players and check if the list is null and the size is > 0. That means there is at least 1 player in the list. Quote Link to comment Share on other sites More sharing options...
FrostBug Posted May 24, 2015 Share Posted May 24, 2015 Any way to get the closest player without looking at name? Player closestPlayer = getPlayers().closest((Filter<Player>) (Player v) -> { return true; }); Quote Link to comment Share on other sites More sharing options...