Git Product home page Git Product logo

php-minecraft-server-status-query's Introduction

#Minecraft Server Status Query

Latest Stable Version Total Downloads Latest Unstable Version License

Minecraft Server Status Query, written in PHP, with online players, motd, favicon and more server related informations without plugins and enable-query.

Tested with Spigot 1.9 and Bungeecord 1.9 & 1.8

Installation

composer require funnyitselmo/minecraftserverstatus

###Tutorial

use MinecraftServerStatus\MinecraftServerStatus;

require '../vendor/autoload.php';

$response = MinecraftServerStatus::query('lostforce.com', 25565);

if (! $response) {
    echo "The Server is offline!";
} else {
    echo "<img width=\"64\" height=\"64\" src=\"" . $response['favicon'] . "\" /> <br>
		The Server " . $response['hostname'] . " is running on " . $response['version'] . " and is online,
		currently are " . $response['players'] . " players online
		of a maximum of " . $response['max_players'] . ". The motd of the server is '" . $response['description'] . "'.
		The server has a ping of " . $response['ping'] . " milliseconds.";
}

If the server is offline MinecraftServerStatus::query returns false else it returns an array which contains the server informations.

###Variables The following table contains the available variables the response can contain. The default value of each variable is false.

Array Index Description
'hostname'
Exact server address in 127.0.0.1 format
'port'
The servers port for example 25565
'ping'
The time in ms the server needs to answer
'version'
The server version
(for example: 1.9)
'protocol'
The server protocol
(for example: 107)
'players'
Amount of players who are currently online
'max_players'
Number of the slots of the server
'description'
The message of the day of the server
'description_raw'
The raw version of description
(contains color codes etc.)
'favicon'
The favicon of the server in a base64 string
(Can be displayed with the html img tag by setting the string as src)
'modinfo'
Informations about the plugins

php-minecraft-server-status-query's People

Contributors

mariogrip avatar zacharydubois avatar games647 avatar metrakit avatar

Watchers

James Cloos avatar Leo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.