Solved Too few arguments EntityLink

Discussion in 'Help' started by Willoxey, Jun 30, 2020.

  1. Willoxey

    Willoxey Spider Jockey

    Messages:
    26
    It's a pet plugin.
    Everytime i mount on the pet it gives this internal

    Code:
    ArgumentCountError: "Too few arguments to function pocketmine\network\mcpe\protocol\types\EntityLink::__construct(), 0 passed in /plugins/BlockPets/src/BlockHorizons/BlockPets/pets/BasePet.php on line 868 and exactly 5 expected" (EXCEPTION) in "src/pocketmine/network/mcpe/protocol/types/EntityLink" at line 43
    
    PHP:
    public function addLink(Entity $entityint $type): void {
            
    $this->removeLink($entity$type);
            
    $viewers $this->getViewers();

            switch(
    $type) {
                case 
    self::LINK_RIDER:
                    
    $link = new EntityLink();
                    
    $link->fromEntityUniqueId $this->getId();
                    
    $link->type self::STATE_SITTING;
                    
    $link->toEntityUniqueId $entity->getId();
                    
    $link->bool1 true;

                    if(
    $entity instanceof Player) {
                        
    $pk = new SetActorLinkPacket();
                        
    $pk->link $link;
                        
    $entity->dataPacket($pk);

                        
    $link_2 = new EntityLink();
                        
    $link_2->fromEntityUniqueId $this->getId();
                        
    $link_2->type self::STATE_SITTING;
                        
    $link_2->toEntityUniqueId 0;
                        
    $link_2->bool1 true;

                        
    $pk = new SetActorLinkPacket();
                        
    $pk->link $link_2;
                        
    $entity->dataPacket($pk);
                        unset(
    $viewers[$entity->getLoaderId()]);
                    }
                    break;
    I've already tried giving it more args. But i keep getting the same error.
     
  2. Mohagames205

    Mohagames205 Spider Jockey

    Messages:
    26
    GitHub:
    mohagames205
    Willoxey likes this.
  3. Willoxey

    Willoxey Spider Jockey

    Messages:
    26
    Now i dont have internal, it says that im mounted but im really not mounted on the pet.
     

Share This Page

  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.