Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. public Horse getHorseDistance(Player p) {
  2.  
  3. double distance = Double.MAX_VALUE;
  4. Horse h = null;
  5.  
  6. for (Entity entity : p.getNearbyEntities(100, 100, 100)) {
  7. if (entity instanceof Horse) {
  8. double dis = p.getLocation().distance(entity.getLocation());
  9. if (dis < distance) {
  10. distance = dis;
  11. h = (Horse) entity;
  12. }
  13. }
  14. }
  15. return h;
  16. }
  17.  
  18.  
  19.  
  20.  
  21. //Narchicht
  22.  
  23. CrachtHorse{cariant=HORSE,owner=CraftPlayer{name=Anzy02}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement