Crates.io | mcping |
lib.rs | mcping |
version | 0.2.0 |
source | src |
created_at | 2020-10-18 22:24:33.195426 |
updated_at | 2021-02-15 15:14:07.26885 |
description | Implementation of the Server List Ping (SLP) part of the Minecraft Modern protocol |
homepage | |
repository | https://github.com/Scetch/mcping |
max_upload_size | |
id | 302491 |
size | 45,603 |
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.
// 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
.