Xephy 237 Posted December 22, 2016 I'm not sure how to check to see if there's another player within a certain distance of your character. Any help?
LogicSoup 92 Posted December 22, 2016 Player and Character API Loop through the available players then use the #distance() method? I'm not sure how to check to see if there's another player within a certain distance of your character. Any help?
Pandemic 2853 Posted December 22, 2016 if (getPlayers().closest(p -> p != null && !p.equals(getLocalPlayer()) && p.distance() < 5) != null) { //If there's a player within 5 tiles of my player //... } I'm not sure if the equals check is needed, but it might be
Xephy 237 Author Posted December 22, 2016 if (getPlayers().closest(p -> p != null && !p.equals(getLocalPlayer()) && p.distance() < 5) != null) { //If there's a player within 5 tiles of my player //... } I'm not sure if the equals check is needed, but it might be Always coming to the rescue, thanks Pandemic.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.