pocketmine\Player::sendPosition PHP Method

sendPosition() public method

public sendPosition ( Vector3 $pos, $yaw = null, $pitch = null, $mode, array $targets = null )
$pos pocketmine\math\Vector3
$targets array
    public function sendPosition(Vector3 $pos, $yaw = null, $pitch = null, $mode = 0, array $targets = null)
    {
        $yaw = $yaw === null ? $this->yaw : $yaw;
        $pitch = $pitch === null ? $this->pitch : $pitch;
        $pk = new MovePlayerPacket();
        $pk->eid = $this->getId();
        $pk->x = $pos->x;
        $pk->y = $pos->y + $this->getEyeHeight();
        $pk->z = $pos->z;
        $pk->bodyYaw = $yaw;
        $pk->pitch = $pitch;
        $pk->yaw = $yaw;
        $pk->mode = $mode;
        if ($targets !== null) {
            Server::broadcastPacket($targets, $pk);
        } else {
            $pk->eid = 0;
            $this->dataPacket($pk);
        }
    }
Player