I made an AimBot command for fun, and I made a repeating task for the sender to look at the other player, here is my code: PHP: case "aimbot": if($sender->getName() == "coEthaniccc" or $sender->getName() == "Epicthic" or $sender->getName() == "WillamLin1128"){ if(!isset($this->aimbot[$sender->getName()])){ $sender->sendMessage(TextFormat::BOLD . TextFormat::RED . "This is a test and should not be abused!"); $this->aimbot[$sender->getName()] = $sender->getName(); $this->getScheduler()->scheduleRepeatingTask(new ClosureTask(function (int $currentTick) use($sender) : void{ if(isset($this->aimbot[$sender->getName()])){ foreach($this->getServer()->getOnlinePlayers() as $player){ if($player->getX() - $sender->getX() <= 10 and $player->getX() - $sender->getX() >= -10 or $player->getZ() - $sender->getZ() <= 10 and $player->getZ() - $sender->getZ() >= -10){ if($player->getPosition() !== $sender->getPosition()){ $sender->lookAt($player->getPosition()); } } } } }), 1); } else { $sender->sendMessage(TextFormat::BOLD . TextFormat::GREEN . "Aimbot has been disabled!"); unset($this->aimbot[$sender->getName()]); } } else { $player->sendMessage(TextFormat::BOLD . TextFormat::RED . "You don't have permission to use this command!"); } return true; break; I think you can't use lookAt for a player, is there any alternative? Thanks in advance! P.S: If you find an error with my code, please tell me