Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Players in a certain area

Comments in 'Plugin Development' started by PixelGuy75, May 1, 2015.

  1. PixelGuy75
    Offline

    PixelGuy75 Notable Member Plugin Developer

    Joined:
    Feb 9, 2014
    Posts:
    316
    Plugins:
    2
    Minecraft User:
    PixelGuy75
    How would I check to see if a player is in a certain area?
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    That depends on how you define "an area".
    Is it a rectangle, given the coords of two points of a diagonal? A triangle, given the coords of the three points? A circle, given the radius and coords of the center? An oval, given the coords of the center, max radius and min radius? A semicircle, given the radius, the coords of the center and the angle to cut the circle from? Or a polygon, given the coords of the points? (So polygon includes triangle too)

    This link may help you with circle, rectangle and polygon (IrregularShape) checking.
    https://github.com/PEMapModder/Small-ZC-Plugins/tree/master/CustomAreas/src/customareas/shape (see the isInside function)
  3. PixelGuy75
    Offline

    PixelGuy75 Notable Member Plugin Developer

    Joined:
    Feb 9, 2014
    Posts:
    316
    Plugins:
    2
    Minecraft User:
    PixelGuy75
    Thanks!

Share This Page

Advertisement