API reference / @jsprismarine/protocol / AvailableCommandsPacket
Class: AvailableCommandsPacket
Defined in: protocol/src/packet/AvailableCommandsPacket.ts:71
Tells the client which commands exist, how each one is spelled, and what it takes.
Wire order at protocol 2193, each list a varuint count then its items:
Enum Values: strings, one shared table every hard enum indexes into.Chained Subcommand Values: strings, one shared table every chained subcommand table indexes into.Post Fixes: strings, the suffixes aPostfixparameter points at.Enum Data:Name(string) thenValues, a list ofuint32indices intoEnum Values. Fixed four bytes each; the width no longer depends on how many values there are.Chained Subcommand Data:Name(string) then a list of{first, second}varuint pairs.Commands:Name,Description,Flags(uint16),Permission Level(string, see commandPermissionToString),Alias Enum(int32 index intoEnum Data, -1 when the command has no aliases),CommandData Chained Subcommand Indexes(uint32 list), thenOverloads:isChaining(bool) andParameter Data:Name,Parse Symbol(uint32),Is Optional?(bool),Options(uint8).Soft Enums:Enum NamethenEnum Options, strings.Constraints:Enum Value Symbol(uint32),Enum Symbol(uint32),Constraint Indices(uint8 list).
A Parse Symbol is a CommandParameterType word for a plain parameter. An enum parameter gets Enum or SoftEnum ORed with Valid and the enum's index in its own table (hard enums, soft enums and chained subcommands are numbered separately); a postfixed one gets Postfix and the index into Post Fixes. The flag bits and type ids live in CommandParameter.ts.
Bound To: Client
See
https://mojang.github.io/bedrock-protocol-docs/1.26.51/packets/available-commands-packet/
Extends
Constructors
Constructor
new AvailableCommandsPacket(
buffer?):AvailableCommandsPacket
Defined in: protocol/src/FieldNetworkPacket.ts:15
A field-based packet has no separate payload object.
Parameters
buffer?
Buffer<ArrayBufferLike>
Returns
AvailableCommandsPacket
Inherited from
FieldNetworkPacket.constructor
Properties
codecProtocol
codecProtocol:
number=protocolVersion
Defined in: protocol/src/NetworkPacket.ts:53
Version stamped by the connection codec for version-gated payloads.
Inherited from
FieldNetworkPacket.codecProtocol
commandData
commandData:
CommandData[] =[]
Defined in: protocol/src/packet/AvailableCommandsPacket.ts:72
enumConstraints
enumConstraints:
CommandEnumConstraint[] =[]
Defined in: protocol/src/packet/AvailableCommandsPacket.ts:75
hardcodedEnums
hardcodedEnums:
CommandEnum[] =[]
Defined in: protocol/src/packet/AvailableCommandsPacket.ts:73
senderSubClientId
senderSubClientId:
number=0
Defined in: protocol/src/NetworkPacket.ts:50
Inherited from
FieldNetworkPacket.senderSubClientId
softEnums
softEnums:
CommandEnum[] =[]
Defined in: protocol/src/packet/AvailableCommandsPacket.ts:74
targetSubClientId
targetSubClientId:
number=0
Defined in: protocol/src/NetworkPacket.ts:51
Inherited from
FieldNetworkPacket.targetSubClientId
Methods
clear()
clear():
void
Defined in: binaryutils/src/BinaryStream.ts:977
Clears the whole BinaryStream instance.
The write buffer and its capacity are kept, so any view previously returned by getWriteBuffer is invalidated. See resetWrite.
Returns
void
Inherited from
FieldNetworkPacket.clear
copyInto()
copyInto(
target,offset?):number
Defined in: binaryutils/src/BinaryStream.ts:856
Copies the encoded bytes into a caller-owned buffer at offset and returns the offset just past them. Lets many packets be encoded into one arena with no per-packet allocation at all.
Parameters
target
Buffer
offset?
number = 0
Returns
number
the new offset
Inherited from
FieldNetworkPacket.copyInto
copyOut()
copyOut():
Buffer
Defined in: binaryutils/src/BinaryStream.ts:840
Returns the encoded bytes as an exactly-sized, standalone Buffer.
Unlike getWriteBuffer the result does not alias this stream, so it survives resetWrite, and it does not pin a pool chunk: because Buffer.allocUnsafe is pool-backed (Buffer.poolSize is 64 KB on current Node), holding on to a handful of small slices from getWriteBuffer can keep megabytes alive.
Returns
Buffer
Inherited from
FieldNetworkPacket.copyOut
decode()
decode(
context?):void
Defined in: protocol/src/FieldNetworkPacket.ts:55
Decodes a legacy field body and leaves the original packet bytes available via getBuffer.
Parameters
context?
Versioned registries and captured data for this connection.
Returns
void
Inherited from
FieldNetworkPacket.decode
decodeHeader()
decodeHeader():
void
Defined in: protocol/src/NetworkPacket.ts:141
Reads and validates the Bedrock packet header from this instance's read buffer.
Returns
void
Inherited from
FieldNetworkPacket.decodeHeader
decodePayload()
decodePayload():
void
Defined in: protocol/src/packet/AvailableCommandsPacket.ts:214
Reads the eight lists back, the mirror of encodePayload.
The shared index tables dissolve into the objects they described: every hard enum lands in hardcodedEnums, every soft enum in softEnums, and a command's alias enum, chained subcommand tables and parameter references point at those objects. The Commands list arrives before the Soft Enums table it indexes into, so parameters naming a soft enum are resolved once that table has been read. An overload's isChaining flag is read past: the encoder derives it from the parameters.
Returns
void
Throws
when a parameter or constraint names an index outside its table.
Overrides
FieldNetworkPacket.decodePayload
deserialize()
deserialize(
stream,context?):unknown
Defined in: protocol/src/NetworkPacket.ts:194
Deserializes the network packet from a binary stream.
Parameters
stream
The stream containing the packet header and body.
context?
Optional protocol data supplied for the connection.
Returns
unknown
The typed packet body.
Inherited from
FieldNetworkPacket.deserialize
encode()
encode(
context?):void
Defined in: protocol/src/FieldNetworkPacket.ts:37
Encodes the legacy field body using this connection's version and supplied protocol data.
Parameters
context?
Versioned registries and captured data for this connection.
Returns
void
Inherited from
FieldNetworkPacket.encode
encodeHeader()
encodeHeader():
void
Defined in: protocol/src/NetworkPacket.ts:136
Writes the Bedrock packet header to this instance's write buffer.
Returns
void
Inherited from
FieldNetworkPacket.encodeHeader
encodePayload()
encodePayload():
void
Defined in: protocol/src/packet/AvailableCommandsPacket.ts:78
Writes the shared enum tables and command records in the protocol's required order.
Returns
void
Overrides
FieldNetworkPacket.encodePayload
encodeTransient()
encodeTransient(
context?):Buffer
Defined in: protocol/src/FieldNetworkPacket.ts:46
Parameters
context?
Returns
Buffer
Inherit Doc
Inherited from
FieldNetworkPacket.encodeTransient
feof()
feof():
boolean
Defined in: binaryutils/src/BinaryStream.ts:875
Returns whatever or not the read offset is at end of line.
Returns
boolean
Inherited from
FieldNetworkPacket.feof
getBuffer()
getBuffer():
Buffer
Defined in: binaryutils/src/BinaryStream.ts:912
Returns the encoded buffer.
Beware: when a read buffer is present this returns that, discarding everything written. On a stream used for both reading and writing it never returns your output.
Returns
Buffer
Deprecated
See getReadBuffer and getWriteBuffer.
Inherited from
FieldNetworkPacket.getBuffer
getEncoded()
getEncoded():
boolean
Defined in: protocol/src/NetworkPacket.ts:93
Returns
boolean
Whether this packet already has encoded bytes in its stream.
Inherited from
FieldNetworkPacket.getEncoded
getId()
getId():
number
Defined in: protocol/src/NetworkPacket.ts:80
Gets the wire id stamped by a version codec, or the packet class's default id.
Returns
number
The packet id for this instance.
Inherited from
FieldNetworkPacket.getId
getName()
getName():
string
Defined in: protocol/src/NetworkPacket.ts:72
The class name used by the server's packet handlers and traffic logs.
Returns
string
The concrete packet class name.
Inherited from
FieldNetworkPacket.getName
getPacketData()
getPacketData():
unknown
Defined in: protocol/src/NetworkPacket.ts:209
Returns the packet body object supplied to the constructor or produced by deserialize.
Returns
unknown
The typed payload, or null before one has been supplied or decoded.
Inherited from
FieldNetworkPacket.getPacketData
getReadBuffer()
getReadBuffer():
Buffer<ArrayBufferLike> |null
Defined in: binaryutils/src/BinaryStream.ts:920
Returns the read buffer if available.
Returns
Buffer<ArrayBufferLike> | null
Inherited from
FieldNetworkPacket.getReadBuffer
getReadIndex()
getReadIndex():
number
Defined in: binaryutils/src/BinaryStream.ts:1019
Retuns the read index.
Returns
number
Inherited from
FieldNetworkPacket.getReadIndex
getWriteBuffer()
getWriteBuffer():
Buffer
Defined in: binaryutils/src/BinaryStream.ts:936
Returns the encoded bytes as a view over this stream's internal buffer.
The view is only valid until the next write: resetWrite, clear and reuse all rewind the cursor without reallocating, so a previously returned buffer is silently overwritten by the next packet. If you queue the result - a send queue, a resend window - use copyOut or copyInto instead.
It also keeps the whole pooled 64 KB chunk it was carved from alive; retaining a scattered handful of small packets this way can pin megabytes.
Returns
Buffer
Inherited from
FieldNetworkPacket.getWriteBuffer
getWriteIndex()
getWriteIndex():
number
Defined in: binaryutils/src/BinaryStream.ts:1027
Returns the write index.
Returns
number
Inherited from
FieldNetworkPacket.getWriteIndex
read()
read(
len):Buffer
Defined in: binaryutils/src/BinaryStream.ts:62
Reads a slice of buffer by the given length.
Parameters
len
number
How many bytes to read: a nonnegative integer.
Returns
Buffer
Throws
AssertionError when len is negative or not an integer, or runs past the end.
Inherited from
FieldNetworkPacket.read
readBoolean()
readBoolean():
boolean
Defined in: binaryutils/src/BinaryStream.ts:179
Reads a boolean (true or false).
Returns
boolean
Inherited from
FieldNetworkPacket.readBoolean
readByte()
readByte():
number
Defined in: binaryutils/src/BinaryStream.ts:143
Reads an unsigned byte (0 to 255).
Returns
number
Inherited from
FieldNetworkPacket.readByte
readDouble()
readDouble():
number
Defined in: binaryutils/src/BinaryStream.ts:481
Returns a 64 bit (8 bytes) big-endian flating point number.
Returns
number
Inherited from
FieldNetworkPacket.readDouble
readDoubleLE()
readDoubleLE():
number
Defined in: binaryutils/src/BinaryStream.ts:501
Returns a 64 bit (8 bytes) little-endian flating point number.
Returns
number
Inherited from
FieldNetworkPacket.readDoubleLE
readFloat()
readFloat():
number
Defined in: binaryutils/src/BinaryStream.ts:441
Returns a 32 bit (4 bytes) big-endian flating point number.
Returns
number
Inherited from
FieldNetworkPacket.readFloat
readFloatLE()
readFloatLE():
number
Defined in: binaryutils/src/BinaryStream.ts:461
Returns a 32 bit (4 bytes) big-endian flating point number.
Returns
number
Inherited from
FieldNetworkPacket.readFloatLE
readInt()
readInt():
number
Defined in: binaryutils/src/BinaryStream.ts:361
Reads a 32 bit (4 bytes) big-endian signed number.
Returns
number
Inherited from
FieldNetworkPacket.readInt
readIntLE()
readIntLE():
number
Defined in: binaryutils/src/BinaryStream.ts:381
Reads a 32 bit (4 bytes) signed number.
Returns
number
Inherited from
FieldNetworkPacket.readIntLE
readLengthPrefixed()
readLengthPrefixed():
Buffer
Defined in: binaryutils/src/BinaryStream.ts:107
Reads a varuint32 byte length, then that many bytes.
Returns
Buffer
The bytes, a view into the stream's buffer.
Inherited from
FieldNetworkPacket.readLengthPrefixed
readLong()
readLong():
bigint
Defined in: binaryutils/src/BinaryStream.ts:521
Returns a 64 bit (8 bytes) signed big-endian number.
Returns
bigint
Inherited from
FieldNetworkPacket.readLong
readLongLE()
readLongLE():
bigint
Defined in: binaryutils/src/BinaryStream.ts:540
Returns a 64 bit (8 bytes) signed little-endian number.
Returns
bigint
Inherited from
FieldNetworkPacket.readLongLE
readRemaining()
readRemaining():
Buffer
Defined in: binaryutils/src/BinaryStream.ts:888
Reads the remaining bytes and returns the buffer slice.
Returns
Buffer
Inherited from
FieldNetworkPacket.readRemaining
readShort()
readShort():
number
Defined in: binaryutils/src/BinaryStream.ts:197
Reads a 16 bit (2 bytes) signed big-endian number.
Returns
number
Inherited from
FieldNetworkPacket.readShort
readShortLE()
readShortLE():
number
Defined in: binaryutils/src/BinaryStream.ts:217
Reads a 16 bit (2 bytes) signed little-endian number.
Returns
number
Inherited from
FieldNetworkPacket.readShortLE
readSignedByte()
readSignedByte():
number
Defined in: binaryutils/src/BinaryStream.ts:161
Reads a signed byte (-128 to 127).
Returns
number
Inherited from
FieldNetworkPacket.readSignedByte
readTriad()
readTriad():
number
Defined in: binaryutils/src/BinaryStream.ts:277
Reads a 24 bit (3 bytes) signed big-endian number.
Returns
number
Inherited from
FieldNetworkPacket.readTriad
readTriadLE()
readTriadLE():
number
Defined in: binaryutils/src/BinaryStream.ts:298
Reads a 24 bit (3 bytes) little-endian number.
Returns
number
Inherited from
FieldNetworkPacket.readTriadLE
readUnsignedInt()
readUnsignedInt():
number
Defined in: binaryutils/src/BinaryStream.ts:401
Reads a 32 bit (4 bytes) big-endian unsigned number.
Returns
number
Inherited from
FieldNetworkPacket.readUnsignedInt
readUnsignedIntLE()
readUnsignedIntLE():
number
Defined in: binaryutils/src/BinaryStream.ts:421
Reads a 32 bit (4 bytes) little-endian unsigned number.
Returns
number
Inherited from
FieldNetworkPacket.readUnsignedIntLE
readUnsignedLong()
readUnsignedLong():
bigint
Defined in: binaryutils/src/BinaryStream.ts:559
Returns a 64 bit (8 bytes) unsigned big-endian number.
Returns
bigint
Inherited from
FieldNetworkPacket.readUnsignedLong
readUnsignedLongLE()
readUnsignedLongLE():
bigint
Defined in: binaryutils/src/BinaryStream.ts:578
Returns a 64 bit (8 bytes) unsigned little-endian number.
Returns
bigint
Inherited from
FieldNetworkPacket.readUnsignedLongLE
readUnsignedShort()
readUnsignedShort():
number
Defined in: binaryutils/src/BinaryStream.ts:237
Reads a 16 bit (2 bytes) unsigned big-endian number.
Returns
number
Inherited from
FieldNetworkPacket.readUnsignedShort
readUnsignedShortLE()
readUnsignedShortLE():
number
Defined in: binaryutils/src/BinaryStream.ts:257
Reads a 16 bit (2 bytes) unsigned little-endian number.
Returns
number
Inherited from
FieldNetworkPacket.readUnsignedShortLE
readUnsignedTriad()
readUnsignedTriad():
number
Defined in: binaryutils/src/BinaryStream.ts:319
Reads a 24 bit (3 bytes) unsigned big-endian number.
Returns
number
Inherited from
FieldNetworkPacket.readUnsignedTriad
readUnsignedTriadLE()
readUnsignedTriadLE():
number
Defined in: binaryutils/src/BinaryStream.ts:340
Reads a 24 bit (3 bytes) unsigned little-endian number.
Returns
number
Inherited from
FieldNetworkPacket.readUnsignedTriadLE
readUnsignedVarInt()
readUnsignedVarInt():
number
Defined in: binaryutils/src/BinaryStream.ts:619
Reads a 32 bit unsigned number.
Returns
number
Inherited from
FieldNetworkPacket.readUnsignedVarInt
readUnsignedVarLong()
readUnsignedVarLong():
bigint
Defined in: binaryutils/src/BinaryStream.ts:702
Reads a 64 bit unsigned variable-length number.
Returns
bigint
Inherited from
FieldNetworkPacket.readUnsignedVarLong
readVarInt()
readVarInt():
number
Defined in: binaryutils/src/BinaryStream.ts:597
Reads a 32 bit (4 bytes) zigzag-encoded number.
Returns
number
Inherited from
FieldNetworkPacket.readVarInt
readVarLong()
readVarLong():
bigint
Defined in: binaryutils/src/BinaryStream.ts:675
Reads a 64 bit zigzag-encoded variable-length number.
Returns
bigint
Inherited from
FieldNetworkPacket.readVarLong
readVarString()
readVarString():
string
Defined in: binaryutils/src/BinaryStream.ts:126
Reads a string: a varuint32 byte length, then UTF-8 bytes, the form Bedrock writes strings in. Named apart from readString because RakNet's packets read theirs with a u16 length. The docs' string primitive
Returns
string
The read string.
Inherited from
FieldNetworkPacket.readVarString
reserve()
reserve(
capacity):this
Defined in: binaryutils/src/BinaryStream.ts:805
Grows the write buffer so that at least capacity bytes can be written without any further allocation, and returns this stream.
Pre-sizing skips the 256 -> 512 -> 1024 ... growth ladder, each step of which copies the whole payload; a 3 KB packet starting from the 256-byte floor performs five allocations and memcpy's 1.25x its own size before it is done.
Parameters
capacity
number
Returns
this
Inherited from
FieldNetworkPacket.reserve
resetWrite()
resetWrite():
void
Defined in: binaryutils/src/BinaryStream.ts:827
Rewinds the write cursor while keeping the allocated capacity, so a long-lived encoder reaches a steady state where it never allocates again. This is the intended way to reuse a stream for many packets.
Note the aliasing contract, which it shares with clear and reuse: any buffer previously handed out by getWriteBuffer is a view over this stream's memory and is invalidated by this call. Use copyOut or copyInto for output you intend to keep.
Returns
void
Inherited from
FieldNetworkPacket.resetWrite
reuse()
reuse(
buf):void
Defined in: binaryutils/src/BinaryStream.ts:991
Conventional method to reuse the stream without having to create a new BinaryStream instance.
The write buffer and its capacity are kept, so any view previously returned by getWriteBuffer is invalidated. See resetWrite.
Parameters
buf
Buffer
The new buffer instance.
Returns
void
Inherited from
FieldNetworkPacket.reuse
serialize()
serialize(
stream,context?):Buffer
Defined in: protocol/src/NetworkPacket.ts:165
Serializes the network packet into a binary stream.
Parameters
stream
The binary stream to serialize into.
context?
Optional protocol data supplied for the connection.
Returns
Buffer
The serialized network packet as a Buffer.
Inherited from
FieldNetworkPacket.serialize
setBuffer()
setBuffer(
buf):void
Defined in: binaryutils/src/BinaryStream.ts:946
Sets the buffer for reading. make sure to reset the reading index!
Parameters
buf
Buffer
The new Buffer.
Returns
void
Deprecated
See setReadBuffer and setWriteBuffer.
Inherited from
FieldNetworkPacket.setBuffer
setNetId()
setNetId(
id):void
Defined in: protocol/src/NetworkPacket.ts:88
Stamps the id selected by a negotiated protocol version.
Parameters
id
number
The packet id in that version's table.
Returns
void
Inherited from
FieldNetworkPacket.setNetId
setReadBuffer()
setReadBuffer(
buf,rIndex?):void
Defined in: binaryutils/src/BinaryStream.ts:955
Sets the buffer for reading.
Parameters
buf
Buffer
The new Buffer.
rIndex?
number = 0
The new read index (default: 0, pass -1 to keep current).
Returns
void
Inherited from
FieldNetworkPacket.setReadBuffer
setReadIndex()
setReadIndex(
index):void
Defined in: binaryutils/src/BinaryStream.ts:1001
Sets the reading index.
Parameters
index
number
The new read index.
Returns
void
Inherited from
FieldNetworkPacket.setReadIndex
setWriteBuffer()
setWriteBuffer(
buf,wIndex?):void
Defined in: binaryutils/src/BinaryStream.ts:965
Sets the buffer for writing.
Parameters
buf
Buffer
The new Buffer.
wIndex?
number = 0
The new write index (default: 0, pass -1 to keep current).
Returns
void
Inherited from
FieldNetworkPacket.setWriteBuffer
setWriteIndex()
setWriteIndex(
index):void
Defined in: binaryutils/src/BinaryStream.ts:1010
Sets the new writing index.
Parameters
index
number
The new write index.
Returns
void
Inherited from
FieldNetworkPacket.setWriteIndex
skip()
skip(
len):void
Defined in: binaryutils/src/BinaryStream.ts:899
Skips len bytes on the buffer.
Parameters
len
number
Returns
void
Inherited from
FieldNetworkPacket.skip
write()
write(
buf):void
Defined in: binaryutils/src/BinaryStream.ts:76
Appends a buffer to the main buffer.
Parameters
buf
Uint8Array
Returns
void
Inherited from
FieldNetworkPacket.write
writeBoolean()
writeBoolean(
v):void
Defined in: binaryutils/src/BinaryStream.ts:188
Writes a boolean (true or false).
Parameters
v
boolean
Returns
void
Inherited from
FieldNetworkPacket.writeBoolean
writeByte()
writeByte(
v):void
Defined in: binaryutils/src/BinaryStream.ts:152
Writes an unsigned byte (0 to 255).
Parameters
v
number
Returns
void
Inherited from
FieldNetworkPacket.writeByte
writeDouble()
writeDouble(
v):void
Defined in: binaryutils/src/BinaryStream.ts:490
Writes a 64 bit (8 bytes) big-endian floating point number.
Parameters
v
number
Returns
void
Inherited from
FieldNetworkPacket.writeDouble
writeDoubleLE()
writeDoubleLE(
v):void
Defined in: binaryutils/src/BinaryStream.ts:510
Writes a 64 bit (8 bytes) little-endian floating point number.
Parameters
v
number
Returns
void
Inherited from
FieldNetworkPacket.writeDoubleLE
writeFloat()
writeFloat(
v):void
Defined in: binaryutils/src/BinaryStream.ts:450
Writes a 32 bit (4 bytes) big-endian floating point number.
Parameters
v
number
Returns
void
Inherited from
FieldNetworkPacket.writeFloat
writeFloatLE()
writeFloatLE(
v):void
Defined in: binaryutils/src/BinaryStream.ts:470
Writes a 32 bit (4 bytes) little-endian floating point number.
Parameters
v
number
Returns
void
Inherited from
FieldNetworkPacket.writeFloatLE
writeInt()
writeInt(
v):void
Defined in: binaryutils/src/BinaryStream.ts:370
Writes a 32 bit (4 bytes) big-endian signed number.
Parameters
v
number
Returns
void
Inherited from
FieldNetworkPacket.writeInt
writeIntLE()
writeIntLE(
v):void
Defined in: binaryutils/src/BinaryStream.ts:390
Writes a 32 bit (4 bytes) little-endian signed number.
Parameters
v
number
Returns
void
Inherited from
FieldNetworkPacket.writeIntLE
writeLengthPrefixed()
writeLengthPrefixed(
buf):void
Defined in: binaryutils/src/BinaryStream.ts:115
Writes a varuint32 byte length, then the bytes.
Parameters
buf
Uint8Array
The bytes to append.
Returns
void
Inherited from
FieldNetworkPacket.writeLengthPrefixed
writeLong()
writeLong(
v):void
Defined in: binaryutils/src/BinaryStream.ts:530
Writes a 64 bit (8 bytes) signed big-endian number.
Parameters
v
bigint
Returns
void
Inherited from
FieldNetworkPacket.writeLong
writeLongLE()
writeLongLE(
v):void
Defined in: binaryutils/src/BinaryStream.ts:549
Writes a 64 bit (8 bytes) signed little-endian number.
Parameters
v
bigint
Returns
void
Inherited from
FieldNetworkPacket.writeLongLE
writeShort()
writeShort(
v):void
Defined in: binaryutils/src/BinaryStream.ts:206
Writes a 16 bit (2 bytes) signed big-endian number.
Parameters
v
number
Returns
void
Inherited from
FieldNetworkPacket.writeShort
writeShortLE()
writeShortLE(
v):void
Defined in: binaryutils/src/BinaryStream.ts:226
Writes a 16 bit (2 bytes) signed little-endian number.
Parameters
v
number
Returns
void
Inherited from
FieldNetworkPacket.writeShortLE
writeSignedByte()
writeSignedByte(
v):void
Defined in: binaryutils/src/BinaryStream.ts:170
Writes a signed byte (-128 to 127).
Parameters
v
number
Returns
void
Inherited from
FieldNetworkPacket.writeSignedByte
writeTriad()
writeTriad(
v):void
Defined in: binaryutils/src/BinaryStream.ts:286
Writes a 24 bit (3 bytes) signed big-endian number.
Parameters
v
number
Returns
void
Inherited from
FieldNetworkPacket.writeTriad
writeTriadLE()
writeTriadLE(
v):void
Defined in: binaryutils/src/BinaryStream.ts:307
Writes a 24 bit (3 bytes) signed little-endian number.
Parameters
v
number
Returns
void
Inherited from
FieldNetworkPacket.writeTriadLE
writeUnsignedInt()
writeUnsignedInt(
v):void
Defined in: binaryutils/src/BinaryStream.ts:410
Writes a 32 bit (4 bytes) big-endian unsigned number.
Parameters
v
number
Returns
void
Inherited from
FieldNetworkPacket.writeUnsignedInt
writeUnsignedIntLE()
writeUnsignedIntLE(
v):void
Defined in: binaryutils/src/BinaryStream.ts:430
Writes a 32 bit (4 bytes) little-endian unsigned number.
Parameters
v
number
Returns
void
Inherited from
FieldNetworkPacket.writeUnsignedIntLE
writeUnsignedLong()
writeUnsignedLong(
v):void
Defined in: binaryutils/src/BinaryStream.ts:568
Writes a 64 bit (8 bytes) unsigned big-endian number.
Parameters
v
bigint
Returns
void
Inherited from
FieldNetworkPacket.writeUnsignedLong
writeUnsignedLongLE()
writeUnsignedLongLE(
v):void
Defined in: binaryutils/src/BinaryStream.ts:587
Writes a 64 bit (8 bytes) unsigned little-endian number.
Parameters
v
bigint
Returns
void
Inherited from
FieldNetworkPacket.writeUnsignedLongLE
writeUnsignedShort()
writeUnsignedShort(
v):void
Defined in: binaryutils/src/BinaryStream.ts:246
Writes a 16 bit (2 bytes) unsigned big-endian number.
Parameters
v
number
Returns
void
Inherited from
FieldNetworkPacket.writeUnsignedShort
writeUnsignedShortLE()
writeUnsignedShortLE(
v):void
Defined in: binaryutils/src/BinaryStream.ts:266
Writes a 16 bit (2 bytes) unsigned little-endian number.
Parameters
v
number
Returns
void
Inherited from
FieldNetworkPacket.writeUnsignedShortLE
writeUnsignedTriad()
writeUnsignedTriad(
v):void
Defined in: binaryutils/src/BinaryStream.ts:328
Writes a 24 bit (3 bytes) unsigned big-endian number.
Parameters
v
number
Returns
void
Inherited from
FieldNetworkPacket.writeUnsignedTriad
writeUnsignedTriadLE()
writeUnsignedTriadLE(
v):void
Defined in: binaryutils/src/BinaryStream.ts:349
Writes a 24 bit (3 bytes) unsigned little-endian number.
Parameters
v
number
Returns
void
Inherited from
FieldNetworkPacket.writeUnsignedTriadLE
writeUnsignedVarInt()
writeUnsignedVarInt(
v):void
Defined in: binaryutils/src/BinaryStream.ts:657
Writes a 32 bit unsigned number with variable-length.
Parameters
v
number
Returns
void
Inherited from
FieldNetworkPacket.writeUnsignedVarInt
writeUnsignedVarLong()
writeUnsignedVarLong(
v):void
Defined in: binaryutils/src/BinaryStream.ts:742
Writes a 64 bit unsigned variable-length number.
Parameters
v
bigint
Returns
void
Inherited from
FieldNetworkPacket.writeUnsignedVarLong
writeUTF8String()
writeUTF8String(
value):void
Defined in: binaryutils/src/BinaryStream.ts:91
Writes a UTF-8 string directly into the stream's backing buffer.
Parameters
value
string
The string to encode.
Returns
void
Inherited from
FieldNetworkPacket.writeUTF8String
writeVarInt()
writeVarInt(
v):void
Defined in: binaryutils/src/BinaryStream.ts:609
Writes a 32 bit (4 bytes) zigzag-encoded number.
Parameters
v
number
Returns
void
Inherited from
FieldNetworkPacket.writeVarInt
writeVarLong()
writeVarLong(
v):void
Defined in: binaryutils/src/BinaryStream.ts:688
Writes a 64 bit unsigned zigzag-encoded number.
Parameters
v
bigint
Returns
void
Inherited from
FieldNetworkPacket.writeVarLong
writeVarString()
writeVarString(
str):void
Defined in: binaryutils/src/BinaryStream.ts:134
Writes a string as a varuint32 byte length, then UTF-8 bytes.
Parameters
str
string
The string to write.
Returns
void
Inherited from
FieldNetworkPacket.writeVarString