#minecraft-server #ping #minecraft #status #server #api-bindings #serverlistping

mcping

Implementation of the Server List Ping (SLP) part of the Minecraft Modern protocol

4 releases

0.2.0 Feb 15, 2021
0.1.2 Dec 29, 2020
0.1.1 Oct 19, 2020
0.1.0 Oct 18, 2020

#34 in #minecraft-server

28 downloads per month
Used in mc-legacy-formatting

MIT/Apache

14KB
230 lines

mcping

crate documentation Crates.io version Crates.io downloads CI

mcping is a Rust crate that can ping a Minecraft server and collect ping information such as the MOTD, max player count, player sample, etc.

Note: mcping currently only supports Minecraft Java edition.

Example

// Ping the server and gather status information and latency.
let (latency, status) = mcping::get_status("mc.hypixel.net", Duration::from_secs(10))?;

println!("latency: {}", latency);
print!("version: {}", status.version.name);
println!("description: {}", status.description.text());
println!("players: {}/{}", status.players.online, status.players.max);

A more complete example can be found in the cli example (examples/cli.rs) and can be run with cargo run --example cli.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~7.5MB
~170K SLoC