Well, for a block at exactly 123.123.123 it's: PHP: public function onBlockPlace(BlockPlaceEvent $event) { if ($event->getBlock()->x === 123 && $event->getBlock()->y === 123 && $event->getBlock()->z === 123) { $event->setCancelled(); }} But for an area you would have to check for its borders, that is if block's x is greater than area's minX and smaller than area's maxX, etc.
PHP: public function onPlace(BlockPlaceEvent $event) { if ($event->getBlock()->x === 123 && $event->getBlock()->y === 123 && $event->getBlock()->z === 123) { $event->setCancelled(true); }}
The OP ask to make an area he can thus use min and max and of other method. I prefere the method of the min and max.
I believe he meant you can use those functions for calculating lowest and highest borders of your area, when player chooses two points like this:
PHP: /** * @param Vector3 $area_pos * @param Player $p * @return bool */ public function area(Vector3 $area_pos, Player $p) { if (min($area_pos->x - 0.5, $area_pos->x + 0.5) <= $p->getX() && max($area_pos->x - 0.5, $area_pos->x + 0.5) >= $p->getX() && min($area_pos->y - 0.5, $area_pos->y + 0.5) <= $p->getY() && max($area_pos->y - 0.5, $area_pos->y + 0.5) >= $p->getY() && min($area_pos->z - 0.5, $area_pos->z + 0.5) <= $p->getZ() && max($area_pos->z + 0.5, $area_pos->z - 0.5) >= $p->getZ()) { return true; } return false; } Oh Sorry I didn't know that Seriously ?? Please when you understand nothing in English and you put your explanations as if I did not know, to look at my code subject of min and max I think that you have a lot to learn.
Yeah, I agree. But at least I try to be understood. And a question to everyone else in this thread: whose English you can understand better - mine or his? Vote now on your phones.
Go do your hero !! that the staff and the person here does not like that and avoid spam, because I answer you in each post made a new post (OFF-Topic) talk about your life. .