Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mops1k/minecraftserverstatus

Minecraft Server Status, library to make query for get server information with online players, motd, favicon and more related informations without plugins and enable-query.
https://github.com/mops1k/minecraftserverstatus

Last synced: 3 days ago
JSON representation

Minecraft Server Status, library to make query for get server information with online players, motd, favicon and more related informations without plugins and enable-query.

Awesome Lists containing this project

README

        

#Minecraft Server Status

Minecraft Server Status, library to make query with online players, motd, favicon and more server related informations without plugins and enable-query.

*Tested with Spigot 1.11

### Installation
```
composer require mops1k/minecraftserverstatus
```
###Tutorial
```php
setHost('localhost')
->setPort(25565)
;

if (!$status->query()) {
echo "The Server is offline!";
} else {
$data = $status->getData();

if ($data->getFavicon()) {
echo "getFavicon() . "\" />
";
}
echo "The Server " . $data->getHostname() . " is running on " . $data->getVersion() . " and is online,
currently are " . $data->getPlayers() . " players online
of a maximum of " . $data->getMaxPlayers() . ". The motd of the server is '" . $data->getDescription() . "'.
The server has a ping of " . $data->getPing() . " milliseconds.";
}
```
If the server is offline $status->query() returns false else it returns true and fill the server informations to $status->getData().