Plugin that tells you if a player is within a 100 block diameter from you.

Discussion in 'Archived: Plugin Requests' started by Antigrate, Mar 18, 2014.

  1. Offline

    Antigrate

    Hi, could someone do this? I don't think it would be that hard, but I tried it myself but I'm having so much trouble (still learning Java). Thank you!
     
  2. Offline

    YoshiGenius

    On command, or otherwise?
     
  3. Offline

    Mindcraftson

    If your looking for a plugin with a command that does this, then essentials has the /near command.
     
    tylerthecreeper1 likes this.
  4. Offline

    YoshiGenius

    My guess is that they don't want to install the megalith of Essentials.
     
    Mindcraftson likes this.
  5. Offline

    xEpicTaco

    Simply:

    Code:java
    1.  
    2. ArrayList<Entity> nearby = (ArrayList<Entity>) player.getNearbyEntities(50, 50, 50);
    3. for(int x = 0; x < nearby.size(); x++)
    4. {
    5. if(nearby.get(x) instanceof Player)
    6. {
    7. Player target = (Player) nearby.get(x);
    8. player.sendMessage("Player " + target.getDisplayName() + " is near you!");
    9. }
    10. }
    11.  
     

Share This Page