Download the PHP package randomhost/mcstat without Composer
On this page you can find all versions of the php package randomhost/mcstat. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download randomhost/mcstat
More information about randomhost/mcstat
Files in randomhost/mcstat
Package mcstat
Short Description Retrieves status information from a Minecraft server.
License MIT
Homepage https://www.random-host.com
Informations about the package mcstat
randomhost/mcstat
PHP class, web page, CLI tool, and Munin plugin to get information from a Minecraft server.
This package is a fork of winny-/mcstat which cleans up the package and adds Composer support so it can be used within other Composer packages.
Protocol Support
mcstat supports Server List Ping as seen in 1.7
and later, and 1.5.2
.
Server List Ping 1.5.2
works for older Minecraft servers (all the way back to
1.4.2
), while the 1.7
Server List Ping should be used for newer setups.
mcstat also supports the UDP full and basic Query protocols.
Usage
minecraftusers — A Munin plugin
Install minecraft_users_
like any other munin plugin:
No configuration is necessary because minecraft_users_
is a wildcard plugin.
mcstat as a program
src/bin/mcstat.php
is a script for querying Minecraft servers. You can install
a stand-alone version like so:
It's very simple and gets the job done:
This will output the status of the given server like so:
Please note: TERM
must be set to a known terminal, otherwise PHP spams
stderr unconditionally.
stat.php
src/www/stat.php
is a simple web page that lets users query a given server.
Note: stat.php
shouldn't be used on a public server as it's not well tested!
Usage as a PHP Class
This outputs server information in the following format:
Testing
The testing script requires bash
, phpunit
, and java
. The tests are
ran against against a live server running on localhost.
Run the script as follows:
By default src/tests/unit-tests/bin/testrunner.sh
tests against all server
versions 1.4.2
and later.
Override this like so: