#minecraft #minecraft-server #protocols #api

nightly mcio

minecraft server list ping library

6 releases

0.3.1 Apr 19, 2020
0.3.0 Apr 18, 2020
0.2.0 Apr 18, 2020
0.1.4 Apr 18, 2020

#65 in #minecraft-server

31 downloads per month

MIT license

12KB
249 lines

mcio is a simple library for Rust that completes a Minecraft handshake and server list ping. It can be used to fetch a Minecraft server's:

  • Version (including name and protocol number)
  • Players
    • Max players
    • Online players
    • Online players sample
  • MOTD
  • Icon

As of right now, all calls to mcio are blocking.

Example Usage

fn main() {
    let response = mcio::ping("mc.hypixel.net", 25565, 315).expect("Failed to get response.");

    println!("Players: {}/{}", response.players.online, response.players.max);
    /* Players: 62075/85000 */
}

Dependencies

~11–17MB
~240K SLoC