Beispiel #1
0
    private void SendPlayerPositionAndLook(IMinecraftUser user, Position position)
    {
        using var packet = new PlayerPositionAndLookPacket();

        packet.WriteDouble(position.X); // x
        packet.WriteDouble(position.Y); // y
        packet.WriteDouble(position.Z); // z
        packet.WriteSingle(0);          // yaw
        packet.WriteSingle(0);          // pitch
        packet.WriteByte(0);
        //packet.WriteByte(0x01 | 0x02 | 0x04); // position flags (x|y|z)
        packet.WriteVarInt32(0); // teleport id

        user.Send(packet);
    }