Documentation
¶
Index ¶
Constants ¶
View Source
const ( UnknownProtoVersion = -1 StatusState = 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatComponent ¶
type ChatComponent struct {
RegularChatComponent
}
Wraps a RegularChatComponent for parsing both regular & string-only MOTD's
func (*ChatComponent) UnmarshalJSON ¶
func (c *ChatComponent) UnmarshalJSON(data []byte) error
type InvalidPacketError ¶
type InvalidPacketError struct {
// contains filtered or unexported fields
}
InvalidPacketError returned when the received packet type does not match the expected packet type.
func (InvalidPacketError) Error ¶
func (i InvalidPacketError) Error() string
type Pinger ¶
type Pinger interface {
Ping() (*ServerInfo, error)
}
Pinger allows you to retrieve server info.
type Player ¶
type Player struct { Name string `json:"name"` // Player name ID string `json:"id"` // Player UUID }
Server info player
type Players ¶
type Players struct { Max uint `json:"max"` // Max amount of players allowed Online uint `json:"online"` // Amount of players online Sample []Player // Sample of online players }
Server info players
type RegularChatComponent ¶
type RegularChatComponent struct { Text string `json:"text"` // Text content Bold bool `json:"bold"` // Component is emboldened Italic bool `json:"italic"` // Component is italicized Underlined bool `json:"underlined"` // Component is underlined Strikethrough bool `json:"strikethrough"` // Component is struck out Obfuscated bool `json:"obfuscated"` // Component randomly switches between characters of the same width Color string `json:"color"` // Contains the color for the component Extra []RegularChatComponent `json:"extra"` // RegularChatComponent siblings }
Minecraft chat component See: https://wiki.vg/Chat#Current_system_.28JSON_Chat.29
type ServerInfo ¶
type ServerInfo struct { Version Version `json:"version"` // Server version info Players Players `json:"players"` // Server player info Description ChatComponent `json:"description"` // Server description Favicon string `json:"favicon"` // Server favicon }
Server ping response https://wiki.vg/Server_List_Ping#Response
Click to show internal directories.
Click to hide internal directories.