1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

NetworkBinaryStream error

Discussion in 'Plugin Help' started by Bixcoitinho_, May 16, 2021.

  1. Bixcoitinho_

    Bixcoitinho_ Spider

    Messages:
    10
    I'm making an npc plugin, and gave this bug here:
    IMG_20210516_142902.jpg
    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(0Item::get(0,0,0));
            
    $pk->metadata = [
                
    Entity::DATA_FLAGS => [
                    
    Entity::DATA_TYPE_LONG<< Entity::DATA_FLAG_ALWAYS_SHOW_NAMETAG
                    
    << 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_FLOAT0.000001]
            ];
            
    $player->dataPacket($pk);
            
    $this->inventory->sendArmorContents($player);
        }
     
  2. DavyCraft648

    DavyCraft648 Spider Jockey

    Messages:
    40
    GitHub:
    DavyCraft648
    PHP:
    Entity::DATA_NAMETAG => [Entity::DATA_TYPE_STRING$this->getMetadata(4)],
    ?
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.