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

Missing argument for AddEntityPacket

Discussion in 'Development' started by armagadon159753, Oct 28, 2017.

  1. armagadon159753

    armagadon159753 Zombie

    Messages:
    217
    GitHub:
    armagadon159753
    code:
    PHP:
    public function Entity(PlayerJoinEvent $event){
            
    $player $event->getPlayer();
            
    $pk = new AddEntityPacket();
            
    $pk->type 56;
            
    $pk->eid Entity::$entityCount++;
            
    $pk->speedX 0;
            
    $pk->speedY 0;
            
    $pk->speedZ 0;
            
    $pk->yaw 0;
            
    $pk->pitch 0;
            
    $pk->metadata = array();
            
    $pk->$this->data['x'];
            
    $pk->$this->data['y'];
            
    $pk->$this->data['z'];
            
    $player->dataPacket($pk);
            
    $player->getLevel()->addParticle(new FloatingTextParticle(new Vector3($this->data['x'], $this->data['y'], $this->data['z']), ''$this->data['text'], array($player)));
        }
    My code doesnt work fine I forgot an argument but which one?
     
  2. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
  3. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    Use $pk->position = new \pocketmine\math\Vector3(x,y,z);
     
    jasonwynn10 likes this.
  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.