I'm trying to add a player packet to a client when they join but in order to do so you need to add a UUID instance to the Packet. I've tried a ton of different things and I can't get them to work. If somebody can tell me how to get the UUID class to generate a UUID or some alternative way that still uses packets that'd be great. Code: PHP: //The required Classesuse pocketmine\network\protocol\AddPlayerPacket;use pocketmine\utils\UUID;//Skip to the functionspublic function __construct(Player $player, $kitId, $eid, $name, $description, Vector3 $pos, $skin, $slim = false) { $this->player = $player; $this->kitId = $kitId; $this->eid = $eid; $this->uuid = UUID::fromData($eid, $skin, $name); $this->username = $name; $this->description = $description; $this->pos = $pos; $this->skin = $skin; $this->slim = $slim; $this->sendPacket(); } public function sendPacket() { $pk = new AddPlayerPacket(); $pk->eid = $this->eid; $pk->clientID = $this->uuid; $pk->username = $this->createUsername(); $pk->x = $this->pos->x; $pk->y = $this->pos->y; $pk->z = $this->pos->z; $pk->pitch = 0; $pk->yaw = 270; $pk->skin = $this->skin; $pk->isSlim = $this->slim; $this->player->dataPacket($pk); } Error: Code: "Could not pass event 'pocketmine\event\player\PlayerJoinEvent' to 'TTNPC v1-ALPHA': Argument 1 passed to pocketmine\utils\BinaryStream::putUUID() must be an instance of pocketmine\utils\UUID, null given, called in C:\Users\Admin\Desktop\PocketMine\Plugin Tests\src\pocketmine\network\protocol\AddPlayerPacket.php on line 54 and defined on ttnpc\EventListener InvalidArgumentException: "Argument 1 passed to pocketmine\utils\BinaryStream::putUUID() must be an instance of pocketmine\utils\UUID, null given, called in C:\Users\Admin\Desktop\PocketMine\Plugin Tests\src\pocketmine\network\protocol\AddPlayerPacket.php on line 54 and defined" (E_RECOVERABLE_ERROR) in "/src/pocketmine/utils/BinaryStream" at line 194
I've already extensively looked at UUID.php, all the __construct function has defaults for all the variables. I've also looked at the Human.php class and this is how it creates a UUID instance.
Specter spawns a player like he connected from a real client. Specter does not handle anything about spawning players, etc. Specter is basically a plugin that creates a new connection to the server without MCPE.