PHP code example of php-minecraft / minecraft-query
1. Go to this page and download the library: Download php-minecraft/minecraft-query library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// use this cosntructor if you dont want separate address to host and port
$resolver = MinecraftQueryResolver::fromAddress('play.minecord.net');
// use this method if you want raw data in array retrieved from minecraft server
$rawData = $resolver->getRawData();
// use this method if you want construct MinecraftQueryResult from raw data
$result = MinecraftQueryResult::fromRawData($rawData);
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.