A C# library for querying/pinging Minecraft servers.
See sample code below for basic usage.
using MCQuery;
using System;
namespace Sample
{
public class Program
{
private static string address = "mc.hypixel.net";
private static int port = 25565;
public static void Main(string[] args)
{
MCServer server = new MCServer(address, port);
ServerStatus status = server.Status();
double ping = server.Ping();
Console.WriteLine($"Server: {server.Address}:{server.Port}");
Console.WriteLine($"Ping: {ping}ms");
Console.WriteLine($"Status: {status.Players.Online}");
}
}
}
Recommended way of installing is through NuGet where packages are updated alongside master branch.
For the latest features (bleeding-edge), clone this repository and open the MCQuery/MCQuery.sln
solution in Visual Studio. Build using the Release configuration and use the MCQuery/bin/Release/netstandard2.0/MCQuery.dll
file in your project.
Alternatively, you can download the DLL (not always up-to-date) from the Release page.