Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Resolved Checking if player is in area

cuppa.drink(java);
Joined
Mar 13, 2018
Messages
7,097
I think what you're asking for is to check if the local player is within a certain area? If so:

Code:
        Player pl;
        Area a = new Area.Rectangular(new Coordinate(0,0,1), new Coordinate(5,5,1));
        if((pl=Players.getLocal())!=null && a.contains(pl)) {
            //player is in area a
        }

Where Area a is outlined by bottom left coord (0,0,1) and top right coord (5,5,1).

More info: Area and Area.Rectangular


Edit: Just for the record, this thread should be in the section Developer Support
 
Top