hey, im not sure why i get this error... could it be because i am using an outdated reference? Code: [Server thread/CRITICAL]: Could not pass event 'pocketmine\event\player\PlayerJoinEvent' to 'Advanced_Welcome v0.1': Argument 1 passed to pocketmine\network\mcpe\NetworkBinaryStream::putEntityUniqueId() must be of the type integer, null given, called in phar://C:/Users/steve/Desktop/MCPE server/faction server/PocketMine-MP.phar/src/pocketmine/network/mcpe/protocol/AddEntityPacket.php on line 96 on Atom\Main [Server thread/CRITICAL]: TypeError: "Argument 1 passed to pocketmine\network\mcpe\NetworkBinaryStream::putEntityUniqueId() must be of the type integer, null given, called in phar://C:/Users/steve/Desktop/MCPE server/faction server/PocketMine-MP.phar/src/pocketmine/network/mcpe/protocol/AddEntityPacket.php on line 96" (EXCEPTION) in "src/pocketmine/network/mcpe/NetworkBinaryStream" at line 286 and my code: PHP: public function onJoin(PlayerJoinEvent $event){ $player = $event->getPlayer(); $name = $player->getName(); $this->sendLightning($player);}public function sendLightning(Player $player){ $level = $player->getLevel(); $light = new AddEntityPacket(); $light->type = 93; $light->eid = Entity::$entityCount++; $light->metadata = array(); $light->speedX = 0; $light->speedY = 0; $light->speedZ = 0; $light->yaw = $player->getYaw(); $light->pitch = $player->getPitch(); $light->x = $player->x; $light->y = $player->y; $light->z = $player->z; $this->getServer()->broadcastPacket($level->getPlayers(), $light);}
PHP: $x = $y = $z = 1;$pk = new AddEntityPacket();$pk->entityRuntimeId = Entity::$entityCount++;$pk->type = 93;$pk->position = new Vector3($x, $y, $z);$pk->motion = null;foreach(Level->getPlayers() as $players) { $players->dataPacket($pk);}