SerenityJS
    Preparing search index...

    Class LegacyTelemetryEventPacket

    Represents a Minecraft Bedrock Edition data packet

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    buffer: Buffer

    The buffer that this stream operates on.

    event_data:
        | undefined
        | { achievementId: number }
        | {
            interactedEntityId: bigint;
            interactionActorColor: number;
            interactionActorType: number;
            interactionActorVariant: number;
            interactionType: number;
        }
        | { dimensionId: number }
        | { fromDimensionId: number; toDimensionId: number }
        | {
            damageSource: number;
            instigatorActorId: bigint;
            instigatorChildActorType: number;
            targetActorId: bigint;
            traderName: string;
            tradeTier: number;
        }
        | { contentsColor: number; contentsType: number; fillLevel: number }
        | {
            damageSource: number;
            diedInRaid: boolean;
            instigatorActorId: bigint;
            instigatorMobVariant: number;
        }
        | { bossActorId: bigint; bossType: number; partySize: number }
        | {
            commandName: string;
            result: number;
            resultKey: string;
            resultNumber: number;
            resultString: string;
        }
        | Record<string, never>
        | {
            commandName: string;
            errorCount: number;
            errorList: string;
            successCount: number;
        }
        | { color: number; entityType: number; entityVariant: number }
        | {
            damageSource: number;
            killedPetEntityType: number;
            killedPetVariant: number;
            killerEntityType: number;
            killerVariant: number;
        }
        | { blockInteractionType: number; itemId: number }
        | { blockInteractionType: number; itemId: number }
        | { itemId: number }
        | { eventName: string }
        | { currentRaidWave: number; totalRaidWaves: number; wonRaid: boolean }
        | { redstoneLevel: number }
        | { itemId: number; wasTargetingBarteringPlayer: boolean }
        | { playerWaxedOrUnwaxedCopperBlockId: number }
        | { codeBuilderRuntimeAction: string }
        | { codeBuilderScoreboardScore: number; objectiveName: string }
        | { itemAux: number; itemId: number; useCount: number; useMethod: number }
    offset: number

    The current offset in the buffer from which to read or write data.

    unique_id: bigint
    use_player_id: number
    id: Packet

    The packet id.

    id_type: typeof VarInt = VarInt

    The packet id data type.

    Methods

    • Check if the offset is at the end of the buffer.

      Returns boolean

      Whether the offset is at the end.

    • Get the current buffer of the stream.

      Returns Buffer

      The current buffer up to the current offset.

    • Gets the packet id.

      Returns number

      The packet id.

    • Gets the packet id data type.

      Returns typeof DataType

      The packet id data type.

    • Read a specified number of bytes from the stream.

      Parameters

      • length: number

        The number of bytes to read.

      Returns Buffer

      The read bytes as a Buffer.

      The buffer returned is a subarray of the original buffer.

    • Read a boolean value from the stream.

      Returns boolean

      The read boolean value.

    • Read a 32-bit floating point number from the stream.

      Parameters

      • Optionalendian: Endianness

        The endianness to use for reading.

      Returns number

      The read 32-bit float.

    • Read a 16-bit signed integer (i16) from the stream.

      Parameters

      • Optionalendian: Endianness

        The endianness to use for reading.

      Returns number

      The read 16-bit signed integer.

    • Read a 24-bit signed integer (i24) from the stream.

      Parameters

      • Optionalendian: Endianness

        The endianness to use for reading.

      Returns number

      The read 24-bit signed integer.

    • Read a 32-bit signed integer (i32) from the stream.

      Parameters

      • Optionalendian: Endianness

        The endianness to use for reading.

      Returns number

      The read 32-bit signed integer.

    • Read a 64-bit signed integer (i64) from the stream.

      Parameters

      • Optionalendian: Endianness

        The endianness to use for reading.

      Returns bigint

      The read 64-bit signed integer.

    • Read a 8-bit signed integer (i8) from the stream.

      Returns number

      The read 8-bit signed integer.

    • Read a 16-bit string from the stream.

      Parameters

      • Optionalendian: Endianness

        The endianness to use for reading.

      Returns string

      The read string.

    • Read a 32-bit string from the stream.

      Parameters

      • Optionalendian: Endianness

        The endianness to use for reading.

      Returns string

      The read string.

    • Read a 16-bit unsigned integer (u16) from the stream.

      Parameters

      • Optionalendian: Endianness

        The endianness to use for reading.

      Returns number

      The read 16-bit unsigned integer.

    • Read a 24-bit unsigned integer (u24) from the stream.

      Parameters

      • Optionalendian: Endianness

        The endianness to use for reading.

      Returns number

      The read 24-bit unsigned integer.

    • Read a 32-bit unsigned integer (u32) from the stream.

      Parameters

      • Optionalendian: Endianness

        The endianness to use for reading.

      Returns number

      The read 32-bit unsigned integer.

    • Read a 64-bit unsigned integer (u64) from the stream.

      Parameters

      • Optionalendian: Endianness

        The endianness to use for reading.

      Returns bigint

      The read 64-bit unsigned integer.

    • Read a 8-bit unsigned integer (u8) from the stream.

      Returns number

      The read 8-bit unsigned integer.

    • Read a variable-length integer (varint) from the stream.

      Returns number

      The read variable-length integer.

    • Read a variable-length long integer (varlong) from the stream.

      Returns bigint

      The read variable-length long integer.

    • Read a variable-length string from the stream.

      Returns string

      The read variable-length string.

    • Read a ZigZag encoded integer from the stream.

      Returns number

      The decoded integer.

    • Read a ZigZong encoded integer from the stream.

      Returns bigint

      The decoded ZigZong integer.

    • Validate if the current offset plus the specified length exceeds the buffer length.

      Parameters

      • length: number

        The length to validate against the current offset.

      Returns boolean

      True if the offset is valid, false otherwise.

    • Write a Buffer to the stream at the current offset.

      Parameters

      • data: Buffer

        The Buffer to write to the stream.

      Returns void

    • Write a boolean value to the stream.

      Parameters

      • value: boolean

        The boolean value to write.

      Returns void

    • Write a 32-bit floating point number to the stream.

      Parameters

      • value: number

        The 32-bit float to write.

      • Optionalendian: Endianness

        The endianness to use for writing.

      Returns void

    • Write a 16-bit signed integer (i16) to the stream.

      Parameters

      • value: number

        The 16-bit signed integer to write.

      • Optionalendian: Endianness

        The endianness to use for writing.

      Returns void

    • Write a 24-bit signed integer (i24) to the stream.

      Parameters

      • value: number

        The 24-bit signed integer to write.

      • Optionalendian: Endianness

        The endianness to use for writing.

      Returns void

    • Write a 32-bit signed integer (i32) to the stream.

      Parameters

      • value: number

        The 32-bit signed integer to write.

      • Optionalendian: Endianness

        The endianness to use for writing.

      Returns void

    • Write a 64-bit signed integer (i64) to the stream.

      Parameters

      • value: bigint

        The 64-bit signed integer to write.

      • Optionalendian: Endianness

        The endianness to use for writing.

      Returns void

    • Write a 8-bit signed integer (i8) to the stream.

      Parameters

      • value: number

        The 8-bit signed integer to write.

      Returns void

    • Write a 16-bit string to the stream.

      Parameters

      • value: string

        The string to write.

      • Optionalendian: Endianness

        The endianness to use for writing.

      Returns void

    • Write a 32-bit string to the stream.

      Parameters

      • value: string

        The string to write.

      • Optionalendian: Endianness

        The endianness to use for writing.

      Returns void

    • Write a 16-bit unsigned integer (u16) to the stream.

      Parameters

      • value: number

        The 16-bit unsigned integer to write.

      • Optionalendian: Endianness

        The endianness to use for writing.

      Returns void

    • Write a 24-bit unsigned integer (u24) to the stream.

      Parameters

      • value: number

        The 24-bit unsigned integer to write.

      • Optionalendian: Endianness

        The endianness to use for writing.

      Returns void

    • Write a 32-bit unsigned integer (u32) to the stream.

      Parameters

      • value: number

        The 32-bit unsigned integer to write.

      • Optionalendian: Endianness

        The endianness to use for writing.

      Returns void

    • Write a 64-bit unsigned integer (u64) to the stream.

      Parameters

      • value: bigint

        The 64-bit unsigned integer to write.

      • Optionalendian: Endianness

        The endianness to use for writing.

      Returns void

    • Write a 8-bit unsigned integer (u8) to the stream.

      Parameters

      • value: number

        The 8-bit unsigned integer to write.

      Returns void

    • Write a variable-length integer (varint) to the stream.

      Parameters

      • value: number

        The variable-length integer to write.

      Returns void

    • Write a variable-length long integer (varlong) to the stream.

      Parameters

      • value: bigint

        The variable-length long integer to write.

      Returns void

    • Write a variable-length string to the stream.

      Parameters

      • value: string

        The string to write.

      Returns void

    • Write a ZigZag encoded integer to the stream.

      Parameters

      • value: number

        The integer to encode and write.

      Returns void

    • Write a ZigZong encoded integer to the stream.

      Parameters

      • value: bigint

        The ZigZong integer to encode and write.

      Returns void