Rust Minecraft Server Status Library
A high-performance, asynchronous Rust library for querying the status of both Minecraft Java Edition and Bedrock Edition servers.
Features
- Dual Protocol Support: Ping both Minecraft Java Edition (
25565) and Bedrock Edition (19132) servers. - Async/Await: Built on Tokio for non-blocking operations and high concurrency.
- Batch Queries: Ping multiple servers in parallel with configurable concurrency limits.
- DNS Caching: Automatically caches DNS lookups to reduce latency for repeated queries.
- Structured Data: Returns richly structured, serializable data (using
serde), including version info, player counts, MOTD, and sample players. - Favicon Handling: Easily retrieve and save the server's favicon (Java Edition only).
- Robust Error Handling: Comprehensive error types using
thiserror.
Installation
Add this to your Cargo.toml:
[]
= "1.0.1"
= { = "1", = ["full"] }
Usage
Basic Example
use ;
use Duration;
async
Key Structs and Methods
McClient: The main client for making requests.new(),with_timeout(),with_max_parallel()ping(address, edition): Ping a single server.ping_many(servers): Ping multiple servers in parallel.
ServerStatus: The result of a successful ping.online:boollatency:f64data:ServerData(enum containing eitherJavaStatusorBedrockStatus)
JavaStatus: Contains detailed information from a Java server.save_favicon(filename): Saves the base64-encoded favicon to a PNG file.
Examples
See the examples directory for more advanced usage.
basic.rs: The example shown above.- (You can add more example scripts here later, like one for a simple CLI tool)
License
This project is licensed under the MIT License - see the LICENSE file for details.