Hello people, I am still alive and still have questions because I am ALWAYS eager to learn. I have done what the error says and it just tells me to revert it. My plugin runs just fine, until it hits this code and does not anymore: PHP: public function portal($player, $x, $y, $z){ $xMin = $x - 1; $xMax = $x + 1; $yMin = $y - 1; $yMax = $y + 1; $zMin = $z - 1; $zMax = $z + 1; $pos = new Vector3($x,$y,$z); for($x = $xMin; $x <= $xMax; $x++){ for($y = $yMin; $y <= $yMax; $y++){ for($z = $zMin; $z <= $zMax; $z++){ $id = $player->getLevel()->getBlock($pos)->getId(); if(!($id === 8 or $id === 9)) return; $this->play($player, $this->arena); } } } return; } //inside a public function with other code that does not pertain to this issue $this->cords = $this->worlds->getNested("$this->arena.$this->nextSpawnLoc"); $this->world = $this->getServer()->getLevelByName($this->arena); $this->pos = new Position($this->cords[0], $this->cords[1], $this->cords[2], $this->world); $player->teleport($this->pos); Here is the error: Code: [Server thread/NOTICE]: InvalidArgumentException: "Argument 1 passed to pocketmine\Player::sendPosition() must be an instance of pocketmine\math\Vector3, null given, called in phar://C:/Users/Andrey/Downloads/PocketMine-MP/PocketMine-MP.phar/src/pocketmine/Player__32bit.php on line 1859 and defined" (E_RECOVERABLE_ERROR) in "/src/pocketmine/Player__32bit" at line 3176 Thanks for reading, and expect more questions soon
I swear none of the code above or below does anything to it. If classes were not so selfish about variable contents I would have learned php by now.
Please enable debug (set debug.level to 2 in pocketmine.yml) and post the backtrace that displays on console when that happens again with debug on.
PHP: //try$this->cords = $this->worlds->getNested($this->arena.".".$this->nextSpawnLoc); or PHP: //if getNested return the coordinates.$this->cords = new Vector3($this->worlds->getNested($this->arena.".".$this->nextSpawnLoc));
It wouldn't work because Vector3 doesn't accept an array as constructor. Please check before replying.
Heres the BackTrace: Code: [05:33:44] [Server thread/DEBUG]: #0 /src/pocketmine/Player__32bit(1859): pocketmine\Player->sendPosition(NULL , double 79, double 0) [05:33:44] [Server thread/DEBUG]: #1 /src/pocketmine/network/RakLibInterface(140): pocketmine\Player->handleDataPacket(pocketmine\network\protocol\MovePlayerPacket object) [05:33:44] [Server thread/DEBUG]: #2 /src/raklib/server/ServerHandler__32bit(90): pocketmine\network\RakLibInterface->handleEncapsulated(string 192.168.1.17:52152, raklib\protocol\EncapsulatedPacket `▒CX▒B▒=qB▒▒0B▒B▒, integer 0) [05:33:44] [Server thread/DEBUG]: #3 /src/pocketmine/network/RakLibInterface(79): raklib\server\ServerHandler->handlePacket() [05:33:44] [Server thread/DEBUG]: #4 /src/pocketmine/network/Network(146): pocketmine\network\RakLibInterface->process() [05:33:44] [Server thread/DEBUG]: #5 /src/pocketmine/Server__32bit(2485): pocketmine\network\Network->processInterfaces() [05:33:44] [Server thread/DEBUG]: #6 /src/pocketmine/Server__32bit(2300): pocketmine\Server->tick() [05:33:44] [Server thread/DEBUG]: #7 /src/pocketmine/Server__32bit(2178): pocketmine\Server->tickProcessor() [05:33:44] [Server thread/DEBUG]: #8 /src/pocketmine/Server__32bit(1778): pocketmine\Server->start() [05:33:44] [Server thread/DEBUG]: #9 /src/pocketmine/PocketMine(464): pocketmine\Server->__construct(pocketmine\CompatibleClassLoader object, pocketmine\utils\MainLogger object, string phar://C:/Users/Andrey/Downloads/PocketMine-MP/PocketMine-MP.phar/, string C:\Users\Andrey\Downloads\PocketMine-MP\, string C:\Users\Andrey\Downloads\PocketMine-MP\plugins\) [05:33:44] [Server thread/DEBUG]: #10 (1): require(string phar://C:/Users/Andrey/Downloads/PocketMine-MP/PocketMine-MP.phar/src/pocketmine/PocketMine.php)
Oops, Sorry everyone, Seems that the issue was that I only set 8 positions in the config, and it was teleporting me so many times it quickly ran through those 8 positions and crashed.