Text

Sends or receives a message from the player. Every variant's field can contain Minecraft's formatting codes. Every packet sent in the same game tick should be joined together with \n§r (line break and reset formatting), otherwise the messages will be displayed multiple times on the client's chat (see MCPE-17631).

Constructors

this
this()
Undocumented in source.
this
this(ubyte type)
Undocumented in source.

Members

Aliases

Variants
alias Variants = TypeTuple!(Raw, Chat, Translation, Popup, Tip, System, Whisper)
Undocumented in source.
_encode
alias _encode = encode
Undocumented in source.

Classes

Chat
class Chat

Chat message sent by the player to the server. If sent from the server it will display as <sender> message.

Popup
class Popup

Displays popups messages for one tick before fading out. The popup messages are displayed at the centre of the screen and are not automatically aligned horizontally.

Raw
class Raw

Raw message that will be printed in the chat as it is.

System
class System
Undocumented in source.
Tip
class Tip

Displays a tip message for one tick before fading out. The tip message is displayed on top of the inventory bar and can contain multiple lines separated with \n.

Translation
class Translation

Sends a message that will be translated client-side using the player's language.

Whisper
class Whisper

Sends a whisper message to the client that will be displayed in the format `<i>sender has whispered to you:</i> message`.

Functions

decode
void decode()
Undocumented in source. Be warned that the author may not have intended to support it.
encode
ubyte[] encode()
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

fromBuffer
Text fromBuffer(ubyte[] buffer)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

CLIENTBOUND
enum bool CLIENTBOUND;
Undocumented in source.
FIELDS
enum string[] FIELDS;
Undocumented in source.
ID
enum ubyte ID;
Undocumented in source.
SERVERBOUND
enum bool SERVERBOUND;
Undocumented in source.
type
ubyte type;
Undocumented in source.
variantField
enum string variantField;
Undocumented in source.

Inherited Members

From Buffer

_buffer
ubyte[] _buffer;
Undocumented in source.
_index
size_t _index;
Undocumented in source.
bufferInstance
Buffer bufferInstance [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
writeBytes
void writeBytes(ubyte[] bytes)
Undocumented in source. Be warned that the author may not have intended to support it.
writeString
void writeString(string str)
Undocumented in source. Be warned that the author may not have intended to support it.
readBytes
ubyte[] readBytes(size_t length)
Undocumented in source. Be warned that the author may not have intended to support it.
readString
string readString(size_t length)
Undocumented in source. Be warned that the author may not have intended to support it.
writeBigEndianBool
void writeBigEndianBool(bool a)
Undocumented in source. Be warned that the author may not have intended to support it.
readBigEndianBool
bool readBigEndianBool()
Undocumented in source. Be warned that the author may not have intended to support it.
writeLittleEndianBool
void writeLittleEndianBool(bool a)
Undocumented in source. Be warned that the author may not have intended to support it.
readLittleEndianBool
bool readLittleEndianBool()
Undocumented in source. Be warned that the author may not have intended to support it.
writeBigEndianByte
void writeBigEndianByte(byte a)
Undocumented in source. Be warned that the author may not have intended to support it.
readBigEndianByte
byte readBigEndianByte()
Undocumented in source. Be warned that the author may not have intended to support it.
writeLittleEndianByte
void writeLittleEndianByte(byte a)
Undocumented in source. Be warned that the author may not have intended to support it.
readLittleEndianByte
byte readLittleEndianByte()
Undocumented in source. Be warned that the author may not have intended to support it.
writeBigEndianUbyte
void writeBigEndianUbyte(ubyte a)
Undocumented in source. Be warned that the author may not have intended to support it.
readBigEndianUbyte
ubyte readBigEndianUbyte()
Undocumented in source. Be warned that the author may not have intended to support it.
writeLittleEndianUbyte
void writeLittleEndianUbyte(ubyte a)
Undocumented in source. Be warned that the author may not have intended to support it.
readLittleEndianUbyte
ubyte readLittleEndianUbyte()
Undocumented in source. Be warned that the author may not have intended to support it.
writeBigEndianShort
void writeBigEndianShort(short a)
Undocumented in source. Be warned that the author may not have intended to support it.
readBigEndianShort
short readBigEndianShort()
Undocumented in source. Be warned that the author may not have intended to support it.
writeLittleEndianShort
void writeLittleEndianShort(short a)
Undocumented in source. Be warned that the author may not have intended to support it.
readLittleEndianShort
short readLittleEndianShort()
Undocumented in source. Be warned that the author may not have intended to support it.
writeBigEndianUshort
void writeBigEndianUshort(ushort a)
Undocumented in source. Be warned that the author may not have intended to support it.
readBigEndianUshort
ushort readBigEndianUshort()
Undocumented in source. Be warned that the author may not have intended to support it.
writeLittleEndianUshort
void writeLittleEndianUshort(ushort a)
Undocumented in source. Be warned that the author may not have intended to support it.
readLittleEndianUshort
ushort readLittleEndianUshort()
Undocumented in source. Be warned that the author may not have intended to support it.
writeBigEndianTriad
void writeBigEndianTriad(int a)
Undocumented in source. Be warned that the author may not have intended to support it.
readBigEndianTriad
int readBigEndianTriad()
Undocumented in source. Be warned that the author may not have intended to support it.
writeLittleEndianTriad
void writeLittleEndianTriad(int a)
Undocumented in source. Be warned that the author may not have intended to support it.
readLittleEndianTriad
int readLittleEndianTriad()
Undocumented in source. Be warned that the author may not have intended to support it.
writeBigEndianInt
void writeBigEndianInt(int a)
Undocumented in source. Be warned that the author may not have intended to support it.
readBigEndianInt
int readBigEndianInt()
Undocumented in source. Be warned that the author may not have intended to support it.
writeLittleEndianInt
void writeLittleEndianInt(int a)
Undocumented in source. Be warned that the author may not have intended to support it.
readLittleEndianInt
int readLittleEndianInt()
Undocumented in source. Be warned that the author may not have intended to support it.
writeBigEndianUint
void writeBigEndianUint(uint a)
Undocumented in source. Be warned that the author may not have intended to support it.
readBigEndianUint
uint readBigEndianUint()
Undocumented in source. Be warned that the author may not have intended to support it.
writeLittleEndianUint
void writeLittleEndianUint(uint a)
Undocumented in source. Be warned that the author may not have intended to support it.
readLittleEndianUint
uint readLittleEndianUint()
Undocumented in source. Be warned that the author may not have intended to support it.
writeBigEndianLong
void writeBigEndianLong(long a)
Undocumented in source. Be warned that the author may not have intended to support it.
readBigEndianLong
long readBigEndianLong()
Undocumented in source. Be warned that the author may not have intended to support it.
writeLittleEndianLong
void writeLittleEndianLong(long a)
Undocumented in source. Be warned that the author may not have intended to support it.
readLittleEndianLong
long readLittleEndianLong()
Undocumented in source. Be warned that the author may not have intended to support it.
writeBigEndianUlong
void writeBigEndianUlong(ulong a)
Undocumented in source. Be warned that the author may not have intended to support it.
readBigEndianUlong
ulong readBigEndianUlong()
Undocumented in source. Be warned that the author may not have intended to support it.
writeLittleEndianUlong
void writeLittleEndianUlong(ulong a)
Undocumented in source. Be warned that the author may not have intended to support it.
readLittleEndianUlong
ulong readLittleEndianUlong()
Undocumented in source. Be warned that the author may not have intended to support it.
writeBigEndianFloat
void writeBigEndianFloat(float a)
Undocumented in source. Be warned that the author may not have intended to support it.
readBigEndianFloat
float readBigEndianFloat()
Undocumented in source. Be warned that the author may not have intended to support it.
writeLittleEndianFloat
void writeLittleEndianFloat(float a)
Undocumented in source. Be warned that the author may not have intended to support it.
readLittleEndianFloat
float readLittleEndianFloat()
Undocumented in source. Be warned that the author may not have intended to support it.
writeBigEndianDouble
void writeBigEndianDouble(double a)
Undocumented in source. Be warned that the author may not have intended to support it.
readBigEndianDouble
double readBigEndianDouble()
Undocumented in source. Be warned that the author may not have intended to support it.
writeLittleEndianDouble
void writeLittleEndianDouble(double a)
Undocumented in source. Be warned that the author may not have intended to support it.
readLittleEndianDouble
double readLittleEndianDouble()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta