Hello, I'm trying to to stop certian events from being triggered if a player is inside a certian area. I just dont know how to define/make/check the region, is there any chance someone could show me? Thank you
do you need some logic that returns if the player is inside an area? PHP: <?php$object = Position of object; (Vector3/Position/Location/PlayerObject)$area = new Area($vec3startPos, $vec3endPos);unset($vec3startPos);unset($vec3endPos);class Area{ use pocketmine\math\Vector3; private $min = [0,0,0]; private $max = [0,0,0]; public function __construct(Vector3 $vec3startPos, Vector3 $vec3endPos){ $this->min = [$vec3startPos->x, $vec3startPos->y, $vec3startPos->z]; $this->max = [$vec3endPos->x, $vec3endPos->y, $vec3endPos->z]; } public function setStart(Vector3 $vec3startPos){ $this->min = [$vec3startPos->x, $vec3startPos->y, $vec3startPos->z]; return $this; } public function setStop(Vector3 $vec3endpos){ $this->max = [$vec3endPos->x, $vec3endPos->y, $vec3endPos->z]; return $this; } public function isInsideArea(Vector3 $object) : bool{ return ($object->x >= $this->min[0] && $object->x <= $this->max[0] && $object->y >= $this->min[1] && $object->y <= $this->max[1] && $object->z >= $this->min[2] && $object->z <= $this->max[2]); }}