View Source MCPing (mcping v0.4.0)

A utility library to ping other Minecraft: Java Edition servers.

Summary

Functions

Pings a remote Minecraft: Java Edition server.

Functions

Link to this function

get_info(address, port \\ 25565, options \\ [])

View Source
@spec get_info(String.t(), non_neg_integer(), keyword()) ::
  {:ok, map()} | {:error, term()}

Pings a remote Minecraft: Java Edition server.

Parameters

  • address - The address of the server to ping.
  • port - The port of the server to ping. Defaults to 25565.
  • options - A keyword list of options:
    • :timeout - The timeout in milliseconds for the connection. Defaults to 3000.
    • :protocol_version - The protocol version to use for the handshake. Defaults to -1, whose behavior varies by server. Vanilla servers will typically respond with the version they use, Velocity will assume the latest version of Minecraft, and other servers may have different behavior.
    • :virtual_host - The virtual host to use for the handshake. Defaults to the specified address.

Examples

 iex> MCPing.get_info("mc.hypixel.net")
 {:ok, ...}