Awesome Open Source
Awesome Open Source


AppVeyor build status Travis CI build status CodeFactor grade

MineStat is a Minecraft server status checker.

You can use these classes/modules in a monitoring script to poll multiple Minecraft servers 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.

C# example


using System;
using MineStatLib;

class Example
  public static void Main()
    MineStat ms = new MineStat("", 25565);
    Console.WriteLine("Minecraft server status of {0} on port {1}:", ms.Address, ms.Port);
      Console.WriteLine("Server is online running version {0} with {1} out of {2} players.", ms.Version, ms.CurrentPlayers, ms.MaximumPlayers);
      Console.WriteLine("Message of the day: {0}", ms.Motd);
      Console.WriteLine("Latency: {0}ms", ms.Latency);
      Console.WriteLine("Server is offline!");

Go example

package main

import "fmt"
import ""

func main() {
  minestat.Init("", "25565")
  fmt.Printf("Minecraft server status of %s on port %s:\n", minestat.Address, minestat.Port)
  if minestat.Online {
    fmt.Printf("Server is online running version %s with %s out of %s players.\n", minestat.Version, minestat.Current_players, minestat.Max_players)
    fmt.Printf("Message of the day: %s\n", minestat.Motd)
    fmt.Printf("Latency: %s\n", minestat.Latency)
  } else {
    fmt.Println("Server is offline!")

Java example


import land.Frag.MineStat;

class Example
  public static void main(String[] args)
    MineStat ms = new MineStat("", 25565);
    System.out.println("Minecraft server status of " + ms.getAddress() + " on port " + ms.getPort() + ":");
     System.out.println("Server is online running version " + ms.getVersion() + " with " + ms.getCurrentPlayers() + " out of " + ms.getMaximumPlayers() + " players.");
     System.out.println("Message of the day: " + ms.getMotd());
     System.out.println("Message of the day without formatting: " + ms.getStrippedMotd());
     System.out.println("Latency: " + ms.getLatency() + "ms");
     System.out.println("Connected using protocol: " + ms.getRequestType());
      System.out.println("Server is offline!");

JavaScript example


To use the npm package: npm install minestat

var ms = require('minestat');
ms.init('', 25565, function(result)
  console.log("Minecraft server status of " + ms.address + " on port " + ms.port + ":");
    console.log("Server is online running version " + ms.version + " with " + ms.current_players + " out of " + ms.max_players + " players.");
    console.log("Message of the day: " + ms.motd);
    console.log("Latency: " + ms.latency + "ms");
    console.log("Server is offline!");

Perl example


To use the CPAN module: cpan Minecraft::ServerStatus

use Minecraft::ServerStatus;

$ms = Minecraft::ServerStatus::init("", 25565);

print "Minecraft server status of $ms->{address} on port $ms->{port}:\n";
  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";
  print "Server is offline!\n";

PHP example

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 To validate, phpinfo() output will reference mbstring if the feature is enabled.

Packagist Version


$ms = new MineStat("", 25565);
printf("Minecraft server status of %s on port %s:<br>", $ms->get_address(), $ms->get_port());
  printf("Server is online running version %s with %s out of %s players.<br>", $ms->get_version(), $ms->get_current_players(), $ms->get_max_players());
  printf("Message of the day: %s<br>", $ms->get_motd());
  printf("Message of the day without formatting: %s<br>", $ms->get_stripped_motd());
  printf("Latency: %sms<br>", $ms->get_latency());
  printf("Connected using protocol: %s<br>", $ms->get_request_type());
  printf("Server is offline!<br>");

PowerShell example

. .\ServerStatus.ps1

$ms = ServerStatus -Address "" -port 25565
"Minecraft server status of {0} on port {1}:" -f $ms.address, $ms.port

if ($
  "Server is online running with {0} out of {1} players." -f $ms.current_players, $ms.max_players
  "Message of the day: {0}" -f $ms.motd
  "Latency: {0}ms" -f $ms.latency
  "Server is offline!"

Python example


To use the PyPI package: pip install minestat

import minestat

ms = minestat.MineStat('', 25565)
print('Minecraft server status of %s on port %d:' % (ms.address, ms.port))
  print('Server is online running version %s with %s out of %s players.' % (ms.version, ms.current_players, ms.max_players))
  print('Message of the day: %s' % ms.motd)
  print('Message of the day without formatting: %s' % ms.stripped_motd)
  print('Latency: %sms' % ms.latency)
  print('Connected using protocol: %s' % ms.slp_protocol)
  print('Server is offline!')

Ruby example


To use the gem: gem install minestat

require 'minestat'

ms ="", 25565)
puts "Minecraft server status of #{ms.address} on port #{ms.port}:"
  puts "Server is online running version #{ms.version} with #{ms.current_players} out of #{ms.max_players} players."
  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}"
  puts "Server is offline!"

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Javascript (1,552,287
Python (1,137,692
Java (709,307
Php (404,422
Ruby (312,071
C Sharp (278,472
Go (195,887
Perl (36,757
Golang (32,656
Powershell (24,357
Js (9,569
Minecraft (7,330
Protocol (1,259
Query (892
Minecraft Server (665
Checker (512
Status (387
Network Monitoring (361
Packets (323
Poll (220
Related Projects