https://github.com/sergeantserk/mcquery
A C# library for querying/pinging Minecraft servers.
https://github.com/sergeantserk/mcquery
csharp minecraft
Last synced: about 1 year ago
JSON representation
A C# library for querying/pinging Minecraft servers.
- Host: GitHub
- URL: https://github.com/sergeantserk/mcquery
- Owner: SergeantSerk
- License: mit
- Created: 2019-09-18T21:37:06.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-07-13T19:28:15.000Z (almost 4 years ago)
- Last Synced: 2025-03-29T05:41:32.019Z (over 1 year ago)
- Topics: csharp, minecraft
- Language: C#
- Size: 50.8 KB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MCQuery [](https://app.fossa.io/projects/git%2Bgithub.com%2FSergeantSerk%2FMCQuery?ref=badge_shield) [](https://www.codacy.com/gh/SergeantSerk/MCQuery/dashboard?utm_source=github.com&utm_medium=referral&utm_content=SergeantSerk/MCQuery&utm_campaign=Badge_Grade) [](https://ci.appveyor.com/project/SergeantSerk/mcquery)
## Description
A C# library for querying/pinging Minecraft servers.
## Sample Usage
See sample code below for basic usage.
```C#
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](https://www.nuget.org/packages/MCQuery/) 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](https://github.com/SergeantSerk/MCQuery/releases) page.
## License
[](https://app.fossa.io/projects/git%2Bgithub.com%2FSergeantSerk%2FMCQuery?ref=badge_large)