Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/mops1k/minecraftserverstatus
- Owner: mops1k
- License: bsd-3-clause
- Created: 2017-01-31T21:07:03.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-04T22:26:38.000Z (almost 8 years ago)
- Last Synced: 2024-11-02T11:30:05.133Z (14 days ago)
- Language: PHP
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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().