Hello, I would like to have the player entered after the command (/ trolltp <player>) so that the player is teleported to the specific location / position. PHP: $playername = $args[0]; $pos = new Position(24323, 100, 23); $playername->teleport($pos); Can plz help me? Sry for my bad english xD
$playername is a string. Use $server->getPlayerExact($playername) to get the Player instance. Then you can call teleport() on that Player instance.
^the console eczeption Code: Error: "Call to a member function teleport() on string" (EXCEPTION) in "plugins/Troll Plugin/src/bymbc/Main" at line 137
if(($player = $this->getServer()->getPlayer($args[0])) !== null){ $pos = new Position(24323, 100, 23); $player->teleport($pos); }else{ #player is not online }