Ranged chat

Discussion in 'Plugin Development' started by Deckerz, Feb 14, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Deckerz

    Hey buys, i was wondering how to you make ranged chat similar to the minez system without endereyes but they can hear from about 250 blocks away
     
  2. Offline

    SoThatsIt

    just listen to the player chat event (cant remember exactly what is called) and check if the player is less than 250 blocks away and then cancel the event if they aren't. I have no experience with chat related stuff so this may be completely wrong.
     
  3. in my plugin i use:
    List<Player> players = Bukkit.getServer().getOnlinPlayers();
    for(Player getters : players){
    int range = 250;
    if(getters.getLocation().distance(event.getEntity().getLocation()) <= range){
     
  4. Offline

    Go Hard

    You can do this in essentials
     
  5. Offline

    ZeusAllMighty11

    Why would you make a list when getOnlinePlayers() is already returning a list? It's a waste of space honestly
     
  6. in my original class it was ment to get a specific world from the config and search that in the bukkit worlds stuff, so i had to make it a list, i just forgot to change that
     
Thread Status:
Not open for further replies.

Share This Page