Hey, How can i detect what position the player touches a position with PlayerInteractEvent? Not an item a position Thanks for your reply
You think like player touches a block at x=20,y=10,z=30 and you want to get 20,10,30? You can do this with $ev->getBlock()->getX(),$ev...
I wanna know... it doesn't work, i want it if the player Touches a position at X,Y,Z something happens.. but no. PHP: public function onInteract(PlayerInteractEvent $event){if($event->getBlock()->getX() === $this->yml["spleef-start-block-X"] && $event->getBlock()->getY() === $this->yml["spleef-start-block-Y"] && $event->getBlock()->getZ() === $this->yml["spleef-start-block-Z"]){if($this->gameStarted = false){$this->gameStart();}}//if1}//onInteract
PHP: $yml = new Config($this->getDataFolder()."config.yml",Config::YAML);$this->yml = $yml->getAll();
You know, there is a yaml_parse_file function. No difference. You are creating an unnecessary copy of the coordinates while the block already has the information.