Documentation

AvailableCommandsPacket extends DataPacket
in package
implements ClientboundPacket

Interfaces, Classes, Traits and Enums

ClientboundPacket

Table of Contents

ARG_FLAG_ENUM  = 0x200000
Enums are a little different: they are composed as follows: ARG_FLAG_ENUM | ARG_FLAG_VALID | (enum index)
ARG_FLAG_POSTFIX  = 0x1000000
This is used for /xp <level: int>L. It can only be applied to integer parameters.
ARG_FLAG_VALID  = 0x100000
This flag is set on all types EXCEPT the POSTFIX type. Not completely sure what this is for, but it is required for the argtype to work correctly. VALID seems as good a name as any.
ARG_TYPE_COMMAND  = 0x3f
ARG_TYPE_FILEPATH  = 0x10
ARG_TYPE_FLOAT  = 0x3
ARG_TYPE_INT  = 0x1
Basic parameter types. These must be combined with the ARG_FLAG_VALID constant.
ARG_TYPE_JSON  = 0x32
ARG_TYPE_MESSAGE  = 0x2c
ARG_TYPE_OPERATOR  = 0x6
ARG_TYPE_POSITION  = 0x28
ARG_TYPE_RAWTEXT  = 0x2e
ARG_TYPE_STRING  = 0x20
ARG_TYPE_TARGET  = 0x7
ARG_TYPE_VALUE  = 0x4
ARG_TYPE_WILDCARD_INT  = 0x5
ARG_TYPE_WILDCARD_TARGET  = 0x8
HARDCODED_ENUM_NAMES  = ["CommandName" => true]
NETWORK_ID  = \pocketmine\network\mcpe\protocol\ProtocolInfo::AVAILABLE_COMMANDS_PACKET
PID_MASK  = 0x3ff
RECIPIENT_SUBCLIENT_ID_SHIFT  = 12
SENDER_SUBCLIENT_ID_SHIFT  = 10
SUBCLIENT_ID_MASK  = 0x3
$commandData  : array<string|int, mixed>
$enumConstraints  : array<string|int, mixed>
$hardcodedEnums  : array<string|int, mixed>
$recipientSubId  : int
$senderSubId  : int
$softEnums  : array<string|int, mixed>
__get()  : mixed
__set()  : void
canBeSentBeforeLogin()  : bool
create()  : self
decode()  : void
encode()  : void
getName()  : string
handle()  : bool
pid()  : int
decodeHeader()  : void
decodePayload()  : void
Decodes the packet body, without the packet ID or other generic header fields.
encodeHeader()  : void
encodePayload()  : void
Encodes the packet body, without the packet ID or other generic header fields.
getCommandData()  : CommandData
getEnum()  : CommandEnum
getEnumConstraint()  : CommandEnumConstraint
getEnumValueIndex()  : int
getSoftEnum()  : CommandEnum
putCommandData()  : void
putEnum()  : void
putEnumConstraint()  : void
putEnumValueIndex()  : void
putSoftEnum()  : void

Constants

ARG_FLAG_ENUM

Enums are a little different: they are composed as follows: ARG_FLAG_ENUM | ARG_FLAG_VALID | (enum index)

public mixed ARG_FLAG_ENUM = 0x200000

ARG_FLAG_POSTFIX

This is used for /xp <level: int>L. It can only be applied to integer parameters.

public mixed ARG_FLAG_POSTFIX = 0x1000000

ARG_FLAG_VALID

This flag is set on all types EXCEPT the POSTFIX type. Not completely sure what this is for, but it is required for the argtype to work correctly. VALID seems as good a name as any.

public mixed ARG_FLAG_VALID = 0x100000

ARG_TYPE_INT

Basic parameter types. These must be combined with the ARG_FLAG_VALID constant.

public mixed ARG_TYPE_INT = 0x1

ARG_FLAG_VALID | (type const)

NETWORK_ID

public mixed NETWORK_ID = \pocketmine\network\mcpe\protocol\ProtocolInfo::AVAILABLE_COMMANDS_PACKET

RECIPIENT_SUBCLIENT_ID_SHIFT

private mixed RECIPIENT_SUBCLIENT_ID_SHIFT = 12

SENDER_SUBCLIENT_ID_SHIFT

private mixed SENDER_SUBCLIENT_ID_SHIFT = 10

SUBCLIENT_ID_MASK

private mixed SUBCLIENT_ID_MASK = 0x3

Properties

$commandData

public array<string|int, mixed> $commandData = []

List of command data, including name, description, alias indexes and parameters.

$enumConstraints

public array<string|int, mixed> $enumConstraints = []

List of constraints for enum members. Used to constrain gamerules that can bechanged in nocheats mode and more.

$hardcodedEnums

public array<string|int, mixed> $hardcodedEnums = []

List of enums which aren't directly referenced by any vanilla command. This is used for the CommandName enum, which is a magic enum used by the command argument type.

$softEnums

public array<string|int, mixed> $softEnums = []

List of dynamic command enums, also referred to as "soft" enums. These can by dynamically updated mid-game without resending this packet.

Methods

__get()

public __get(string $name) : mixed
Parameters
$name : string
Return values
mixed

__set()

public __set(string $name, mixed $value) : void
Parameters
$name : string
$value : mixed
Return values
void

canBeSentBeforeLogin()

public canBeSentBeforeLogin() : bool
Return values
bool

create()

public static create(array<string|int, CommandData$commandData, array<string|int, CommandEnum$hardcodedEnums, array<string|int, CommandEnum$softEnums, array<string|int, CommandEnumConstraint$enumConstraints) : self
Parameters
$commandData : array<string|int, CommandData>
$hardcodedEnums : array<string|int, CommandEnum>
$softEnums : array<string|int, CommandEnum>
$enumConstraints : array<string|int, CommandEnumConstraint>
Tags
generate-create-func
Return values
self

getName()

public getName() : string
Return values
string

Search results