How do you do it so that when the player goes to coordinate 0,0,0, the player will send a message and cancel it, pls help me :-
PHP: if ($player->getX() === $x &&$player->getY() === $y &&$player->getz() === $z) {//code} Is this what you wanted?
PHP: public function handleMove(\pocketmine\event\player\PlayerMoveEvent $event): void {$player = $event->getPlayer();$x = $player->getX();$y = $player->getY();$z = $player->getZ();}
Just doing Player->getX() (same with y and z) will print out a rational number unless you are at the exact coordinate. So put round($x) to have an estimate coordinate for the players.
PHP: public function onMove(PlayerMoveEvent $event){ $player = $event->getPlayer(); $x = $player->getX(); $y = $player->getY(); $z = $player->getZ(); if($x == 0 && $z == 0){ $event->setCancelled(true); $player->sendMessage( /* Message */ ); }}
Or just make an area and when player enters that area, it does whatever u need to do. I feel like thats much easier and safer to do.