Documentation
¶
Overview ¶
Package chat implements Minecraft's chat message encoding system.
The type Message is the Minecraft chat message. Can be encode as JSON or net/packet.Field .
It's very recommended that use SetLanguage before using Message.String or Message.ClearString, or the translate message will be ignore. Note: The package of data/lang/... will SetLanguage on theirs init() so you don't need do again.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetLanguage ¶
SetLanguage set the translate map to this map.
Types ¶
type Message ¶
type Message jsonChat
Message is a message sent by other
func (Message) ClearString ¶
ClearString return the message String without escape sequence for ansi color.
func (*Message) Decode ¶
func (m *Message) Decode(r pk.DecodeReader) error
Decode for a ChatMsg packet
func (Message) String ¶
String return the message string with escape sequence for ansi color. To convert Translated Message to string, you must set On windows, you may want print this string using github.com/mattn/go-colorable.
func (*Message) UnmarshalJSON ¶
UnmarshalJSON decode json to Message