:chart_with_upwards_trend: A Minecraft server status checker
:chart_with_upwards_trend: A Minecraft server status checker
MineStat is a Minecraft server status checker.
You can use these classes/modules in a monitoring script to poll multiple Minecraft servers, include similar functionality in a Discord bot, or to let visitors see the status of your server from their browser. MineStat has been ported to multiple languages for use with ASP.NET, FastCGI, mod_perl, mod_php, mod_python, Node.js, Rails, Tomcat, and more.
If you are planning to host MineStat on a shared webhost, make sure that the provider allows outbound sockets.
Note: The Go, JavaScript, and Perl implementations are currently under development.
| Protocol | C# | Go | Java | JavaScript | Perl | PHP | PowerShell | Python | Ruby |
|---|---|---|---|---|---|---|---|---|---|
| 1.8b/1.3 (beta) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| 1.4/1.5 (legacy) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| 1.6 (extended legacy) | :heavy_check_mark: | :x: | :heavy_check_mark: | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| >=1.7 (JSON) | :heavy_check_mark: | :x: | :heavy_check_mark: | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| Bedrock/PE/RakNet | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| UT3/GS4 Query | :x: | :x: | :x: | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
…To use the Go package: go get github.com/FragLand/minestat/Go/minestat
……To use the npm package: npm install minestat
…To use the CPAN module: cpan Minecraft::ServerStatus
use Minecraft::ServerStatus;
$ms = Minecraft::ServerStatus::init("minecraft.frag.land", 25565);
print "Minecraft server status of $ms->{address} on port $ms->{port}:\n";
if($ms->{online})
{
print "Server is online running version $ms->{version} with $ms->{current_players} out of $ms->{max_players} players.\n";
print "Message of the day: $ms->{motd}\n";
print "Latency: $ms->{latency}ms\n";
}
else
{
print "Server is offline!\n";
}Note: MineStat for PHP requires multi-byte string support to handle character encoding conversion. Enabling mbstring support can be as simple as installing the php-mbstring package for your platform. If building PHP from source, see https://www.php.net/manual/en/mbstring.installation.php. To validate, phpinfo() output will reference mbstring if the feature is enabled.
…To install the module: Install-Module -Name MineStat
Import-Module MineStat
$ms = MineStat -Address "minecraft.frag.land" -port 25565
"Minecraft server status of '{0}' on port {1}:" -f $ms.Address, $ms.Port
if ($ms.Online) {
"Server is online running version {0} with {1} out of {2} players." -f $ms.Version, $ms.Current_Players, $ms.Max_Players
"Message of the day: {0}" -f $ms.Stripped_Motd
"Latency: {0}ms" -f $ms.Latency
"Connected using SLP protocol '{0}'" -f $ms.Slp_Protocol
}else {
"Server is offline!"
}To use the PyPI package: pip install minestat
…See the Python specific readme (Python/README.md) for a full list of all supported attributes.
To use the gem: gem install minestat
require 'minestat'
ms = MineStat.new("minecraft.frag.land", 25565)
puts "Minecraft server status of #{ms.address} on port #{ms.port}:"
if ms.online
puts "Server is online running version #{ms.version} with #{ms.current_players} out of #{ms.max_players} players."
puts "Game mode: #{ms.mode}" if ms.mode
puts "Message of the day: #{ms.motd}"
puts "Message of the day without formatting: #{ms.stripped_motd}"
puts "Latency: #{ms.latency}ms"
puts "Connected using protocol: #{ms.request_type}"
else
puts "Server is offline!"
endFeel free to submit an issue if you require assistance or would like to make a feature request. You are also welcome to join us on Matrix. Any contributions such as build testing, creating bug reports or feature requests, and submitting pull requests are appreciated. Our code style guidelines can be found in the "Coding Convention" section of CONTRIBUTING.md. Please see the fork and pull guide if you are not certain how to submit a pull request.
No open issues yet, or sync has not completed.