| Crates.io | mc-ping |
| lib.rs | mc-ping |
| version | 0.0.20 |
| created_at | 2025-08-10 10:16:12.861956+00 |
| updated_at | 2025-08-10 16:58:14.104832+00 |
| description | Simple Java Minecraft Server Pinger |
| homepage | |
| repository | https://github.com/cxdsad/mc-ping |
| max_upload_size | |
| id | 1788768 |
| size | 46,526 |
This Rust crate provides functionality to perform Minecraft server status queries using the official Minecraft protocol handshake and status query packets.
It supports:
resolve feature flag).use tokio::time::Duration;
use mc_ping::connection::Connection;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let addr = ("example.com".to_string(), 25565);
// Connect to the server with a timeout of 5 seconds
let mut connection = Connection::new(addr)
connection = connection.timeout(5000)?.connect().await?
// Perform handshake and status query
let status = connection.ping().await?;
println!("Server Status: {:?}", status);
Ok(())
}