I'm creating a MurderMystery plugin from 0%, I'm 98% finished, but I need a command to get to a coordinate (it's an example), that tells you the steps you must do to get there. Can someone give me an example of how to do it?
PHP: public function getPositionSteps(Player $player, Position $position) : int { $playerPosition = $player->getPosition(); $playerX = round($playerPosition->getX()); $playerZ = round($playerPosition->getZ()); $positionX = round($position->getX()); $positionZ = round($position->getZ()); $steps = $playerX - $positionX; $steps = abs($steps + $playerZ - $positionZ); return $steps; }