Documentation ¶
Overview ¶
Package minecraftping is a simple library to ping Minecraft Java Edition servers.
Index ¶
Constants ¶
View Source
const DefaultPort = 25565
DefaultPort is the default Minecraft Java Edition network port.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Response ¶
type Response struct { Version struct { Name string `json:"name"` Protocol int `json:"protocol"` } `json:"version"` Players struct { Max int `json:"max"` Online int `json:"online"` Sample []struct { Name string `json:"name"` Id string `json:"id"` } `json:"sample"` } `json:"players"` Description json.RawMessage `json:"description"` Favicon string `json:"favicon"` }
Response is a representation of the Minecraft Java Edition server's ping response. More information: https://wiki.vg/Server_List_Ping#Response
func Ping ¶
func Ping(address string, port uint16, protocolVersion int, timeout time.Duration) (Response, error)
Ping connects and pings the Minecraft Java Edition server at the specified address and port. protocolVersion dictates which protocol version to attempt the ping with as the response is protocol version dependent. More information: https://wiki.vg/Server_List_Ping
Click to show internal directories.
Click to hide internal directories.