Skip to content

Latest commit

 

History

History
40 lines (32 loc) · 2.07 KB

README.md

File metadata and controls

40 lines (32 loc) · 2.07 KB

MCQuery FOSSA Status Codacy Badge Build status

Description

A C# library for querying/pinging Minecraft servers.

Sample Usage

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}");
        }
    }
}

Installation

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.

License

FOSSA Status