Trying to use the teleport method of the player API. I am attempting to teleport myself to myself. Not sure if this is a bug or if this is a problem in my code. I am only trying to teleport myself to myself because I don't have anyone else to test with atm. Real world it would be from user to user. In the example issuer is PHP: public function testing($cmd,$params,$issuer,$alias) { $player = $this->api->player->get("linuxboytoo"); $player->teleport($player->username,$issuer->username); } Error: Error: array ( 'type' => 4096, 'message' => 'Argument 1 passed to Player::teleport() must be an instance of Vector3, string given, called in /pocketmine/dev/src/API/PluginAPI.php(87) : eval()\'d code on line 36 and defined', 'file' => '/pocketmine/dev/src/Player.php', 'line' => 748, )
You need to get the x y and z of the target player and put them in a variable. It reads the teleport like this $player->teleport(x,y,z) so you can variable those also
The teleport method in the player API doesn't allow for 3 arguments and my understanding looking at te code it's player names that it wants. Am I missing something?
Not yet. The problem is that I want to understand what I'm doing I don't want to just do it for the sake of doing. Do you know why the method doesn't show three arguments and am I maybe using the objects incorrectly?
I was using the player object instead of the player api object. Switched to player API object and it worked great. Next problem is registering commands that can be run by regular users. I get a "You don't have permissions to use this command." when a non-op runs the registered command.