qexyorg/mcserverinfo

MCServerInfo this is a library for get statistics from minecraft server

1.2.0 2019-04-08 11:29 UTC

This package is auto-updated.

Last update: 2024-05-21 08:14:38 UTC


README

Minecraft server stats

Example

Install

composer require qexyorg/mcserverinfo

Example

<?php

use qexyorg\MCServerInfo\MCServerInfo;

require_once('vendor/autoload.php');

$connect = MCServerInfo::Connect('mc.my-super-server.net', 25565);

if(!$connect->request()){
	exit($connect->getError());
}

var_dump($connect->getResponse()->rawData());

In this example, method will be found automatically (Can be slow!!!).

If you know what is a method used you can set it manually

Example with manually method

<?php

use qexyorg\MCServerInfo\MCServerInfo;

require_once('vendor/autoload.php');

$connect = MCServerInfo::Connect('mc.my-super-server.net', 25565)->setMethod(MCServerInfo::METHOD_PING);

if(!$connect->request()){
	exit($connect->getError());
}

var_dump($connect->getResponse()->rawData());

More examples you can find in "examples" folder

Documentation: https://app.gitbook.com/@qexy/s/mcserverinfo/