Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Horse getHorseDistance(Player p) {
- double distance = Double.MAX_VALUE;
- Horse h = null;
- for (Entity entity : p.getNearbyEntities(100, 100, 100)) {
- if (entity instanceof Horse) {
- double dis = p.getLocation().distance(entity.getLocation());
- if (dis < distance) {
- distance = dis;
- h = (Horse) entity;
- }
- }
- }
- return h;
- }
- //Narchicht
- CraftHorse{variant=HORSE,owner=CraftPlayer{name=Anzy02}}
- //
- int blocks = (int) p.getLocation().distance(getHorseDistance(p).getLocation());
- p.sendMessage("§cDein Pferd befindet sich §a" + getHorseDistance(p) + ((blocks == 1) ? " Block" : " Blöcke") + " §centfernt von dir!");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement