I'm making an npc plugin, and gave this bug here: how to resolve the error? code: PHP: public function spawnTo(Player $player) : void { if($player !== $this and !isset($this->hasSpawned[$player->getLoaderId()])){ $this->hasSpawned[$player->getLoaderId()] = $player; } $pk = new AddPlayerPacket(); $pk->uuid = $this->getUniqueId(); $pk->entityUniqueId = 0; $pk->entityRuntimeId = 0; $pk->position = new Vector3($this->x, $this->y, $this->z); $pk->motion = $this->motion; $pk->pitch = $this->pitch; $pk->username = ""; $pk->platformChatId = ""; $pk->buildPlatform = DeviceOS::ANDROID; $pk->yaw = $this->yaw; $pk->item = new ItemStackWrapper(0, Item::get(0,0,0)); $pk->metadata = [ Entity::DATA_FLAGS => [ Entity::DATA_TYPE_LONG, 1 << Entity::DATA_FLAG_ALWAYS_SHOW_NAMETAG ^ 1 << Entity::DATA_FLAG_CAN_SHOW_NAMETAG ], Entity::DATA_NAMETAG => [Entity::DATA_TYPE_STRING, $this->getMetadata(4)], Entity::DATA_LEAD_HOLDER_EID => [Entity::DATA_TYPE_LONG, -1], Entity::DATA_SCALE => [Entity::DATA_TYPE_FLOAT, 0.000001] ]; $player->dataPacket($pk); $this->inventory->sendArmorContents($player); }