World Guard regions: get distance with player

Discussion in 'Plugin Development' started by gamerover98, Nov 23, 2014.

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

    gamerover98

    hello I've question for you:
    [​IMG]
    it is possibile? check if there are regions?
    ty
     
  2. Offline

    Creeoer

    Get the region's locaton and the player's location, and subtract them. The difference will be the distance I believe.
     
  3. Offline

    gamerover98

    I do not know how to take the regions
     
  4. Offline

    ROTN

    WorldGuard has an API, use it.
    And bukkit's location class has a method called distanceSquared.
    Also, instead of getting the region's location, use some maths and make a collection of locations representing a circle. you can then cycle through them to determine if any of those locations are within a region.
     
Thread Status:
Not open for further replies.

Share This Page