Documentation

TextPacket extends DataPacket
in package
implements ClientboundPacket, ServerboundPacket

Interfaces, Classes, Traits and Enums

ClientboundPacket
ServerboundPacket

Table of Contents

NETWORK_ID  = \pocketmine\network\mcpe\protocol\ProtocolInfo::TEXT_PACKET
PID_MASK  = 0x3ff
TYPE_ANNOUNCEMENT  = 8
TYPE_CHAT  = 1
TYPE_JSON  = 10
TYPE_JSON_WHISPER  = 9
TYPE_JUKEBOX_POPUP  = 4
TYPE_POPUP  = 3
TYPE_RAW  = 0
TYPE_SYSTEM  = 6
TYPE_TIP  = 5
TYPE_TRANSLATION  = 2
TYPE_WHISPER  = 7
RECIPIENT_SUBCLIENT_ID_SHIFT  = 12
SENDER_SUBCLIENT_ID_SHIFT  = 10
SUBCLIENT_ID_MASK  = 0x3
$message  : string
$needsTranslation  : bool
$parameters  : array<string|int, mixed>
$platformChatId  : string
$recipientSubId  : int
$senderSubId  : int
$sourceName  : string
$type  : int
$xboxUserId  : string
__get()  : mixed
__set()  : void
canBeSentBeforeLogin()  : bool
decode()  : void
encode()  : void
getName()  : string
handle()  : bool
jukeboxPopup()  : TextPacket
pid()  : int
popup()  : self
raw()  : self
tip()  : self
translatedPopup()  : TextPacket
translation()  : TextPacket
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.
baseTranslation()  : self
messageOnly()  : self

Constants

NETWORK_ID

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

TYPE_ANNOUNCEMENT

public mixed TYPE_ANNOUNCEMENT = 8

TYPE_JSON_WHISPER

public mixed TYPE_JSON_WHISPER = 9

TYPE_JUKEBOX_POPUP

public mixed TYPE_JUKEBOX_POPUP = 4

TYPE_TRANSLATION

public mixed TYPE_TRANSLATION = 2

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

$needsTranslation

public bool $needsTranslation = false

$parameters

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

$platformChatId

public string $platformChatId = ""

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

getName()

public getName() : string
Return values
string

jukeboxPopup()

public static jukeboxPopup(string $key[, array<string|int, string> $parameters = [] ]) : TextPacket
Parameters
$key : string
$parameters : array<string|int, string> = []
Return values
TextPacket

popup()

public static popup(string $message) : self
Parameters
$message : string
Return values
self

raw()

public static raw(string $message) : self
Parameters
$message : string
Return values
self

tip()

public static tip(string $message) : self
Parameters
$message : string
Return values
self

translatedPopup()

public static translatedPopup(string $key[, array<string|int, string> $parameters = [] ]) : TextPacket
Parameters
$key : string
$parameters : array<string|int, string> = []
Return values
TextPacket

translation()

public static translation(string $key[, array<string|int, string> $parameters = [] ]) : TextPacket
Parameters
$key : string
$parameters : array<string|int, string> = []
Return values
TextPacket

encodePayload()

Encodes the packet body, without the packet ID or other generic header fields.

protected encodePayload(PacketSerializer $out) : void
Parameters
$out : PacketSerializer
Return values
void

baseTranslation()

private static baseTranslation(int $type, string $key, array<string|int, string> $parameters) : self
Parameters
$type : int
$key : string
$parameters : array<string|int, string>
Return values
self

messageOnly()

private static messageOnly(int $type, string $message) : self
Parameters
$type : int
$message : string
Return values
self

Search results