API reference / @jsprismarine/protocol / CommandOriginData
Class: CommandOriginData
Defined in: protocol/src/bedrock/wire/structures/CommandOriginData.ts:48
The Origin of a CommandRequestPacket and the Origin Data a CommandOutputPacket sends back, Mojang's CommandOriginData.
Wire order at protocol 2193: Type string, UUID as two uint64 LE halves with the most significant first, RequestId string, PlayerId int64 LE. All four are always present; PlayerId is not conditional on the origin.
See
https://mojang.github.io/bedrock-protocol-docs/1.26.60/types/command-origin-data/
Constructors
Constructor
new CommandOriginData(
type,uuid,requestId,uniqueEntityId):CommandOriginData
Defined in: protocol/src/bedrock/wire/structures/CommandOriginData.ts:61
Parameters
type
uuid
requestId
string
uniqueEntityId
bigint
Returns
CommandOriginData
Properties
requestId
requestId:
string
Defined in: protocol/src/bedrock/wire/structures/CommandOriginData.ts:56
RequestId: the request's id, as the sender chose it.
type
type:
CommandOriginType
Defined in: protocol/src/bedrock/wire/structures/CommandOriginData.ts:50
Type: who or what issued the command. A client's own commands carry Player.
uniqueEntityId
uniqueEntityId:
bigint
Defined in: protocol/src/bedrock/wire/structures/CommandOriginData.ts:59
PlayerId: the unique entity id of the player the origin stands for.
uuid
uuid:
UUIDValue
Defined in: protocol/src/bedrock/wire/structures/CommandOriginData.ts:53
UUID: identifies this run of the command. The reply carries the same one.
Methods
networkSerialize()
networkSerialize(
stream):void
Defined in: protocol/src/bedrock/wire/structures/CommandOriginData.ts:88
Writes one origin to the stream, so that a CommandOutputPacket can carry back the origin its request arrived with.
Type goes out in lower case, the form gophertunnel and Dragonfly send. The reader above matches a name in any casing.
Parameters
stream
Returns
void
networkDeserialize()
staticnetworkDeserialize(stream):CommandOriginData
Defined in: protocol/src/bedrock/wire/structures/CommandOriginData.ts:72
Reads one origin from the stream. A "Type" name this server does not know decodes as Player.
Parameters
stream
Returns
CommandOriginData