PHPackages                             php-minecraft/minecraft-query - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. php-minecraft/minecraft-query

ActiveLibrary[API Development](/categories/api)

php-minecraft/minecraft-query
=============================

Minecraft library for retrieving server data (players, motd, favicon..)

v1.0.2(3y ago)31.1k↓66.7%MITPHPPHP &gt;=7.2

Since Mar 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/PHP-Minecraft/MinecraftQuery)[ Packagist](https://packagist.org/packages/php-minecraft/minecraft-query)[ RSS](/packages/php-minecraft-minecraft-query/feed)WikiDiscussions master Synced today

READMEChangelog (3)DependenciesVersions (4)Used By (0)

MinecraftQuery
==============

[](#minecraftquery)

🛰️ Minecraft PHP library for retrieving server query data

Installation
============

[](#installation)

Required at least PHP 7.2

```
composer require php-minecraft/minecraft-query

```

Example usage
=============

[](#example-usage)

```
declare(strict_types=1);

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

use PHPMinecraft\MinecraftQuery\MinecraftQueryResolver;
```

Minecraft v1.7+
---------------

[](#minecraft-v17)

```
$resolver = new MinecraftQueryResolver('play.minecord.net', 25565);

$result = $resolver->getResult();
```

Minecraft &lt;= v1.6
--------------------

[](#minecraft--v16)

```
$resolver = new MinecraftQueryResolver('play.minecord.net', 25565);

$resolver->retrieveDataPre17();

$result = $resolver->getResult();
```

Autodetect minecraft version (if 1.7+ query fails, older will be used)
----------------------------------------------------------------------

[](#autodetect-minecraft-version-if-17-query-fails-older-will-be-used)

```
$resolver = new MinecraftQueryResolver('play.minecord.net', 25565);

$result = $resolver->getResult($tryOldQueryProtocolPre17 = true);
```

Result data
-----------

[](#result-data)

```
$result->getMaxPlayers() // integer
$result->getOnlinePlayers() // integer
$result->getPlayersSample() // array (players -> sample at https://wiki.vg/Server_List_Ping)
$result->getVersion() // string
$result->getProtocolVersion() // integer
$result->getMessageOfTheDay() // string
$result->getLatency() // integer (ms)
$result->getFavicon() // string or null
```

Tweaks
------

[](#tweaks)

```
// 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);
```

Library (socket logic) is inspired by xPaw/PHP-Minecraft-Query

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~491 days

Total

3

Last Release

1327d ago

PHP version history (2 changes)v1.0.0PHP ^7.2

v1.0.1PHP &gt;=7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/45132928?v=4)[delacry](/maintainers/delacry)[@delacry](https://github.com/delacry)

---

Top Contributors

[![delacry](https://avatars.githubusercontent.com/u/45132928?v=4)](https://github.com/delacry "delacry (31 commits)")

---

Tags

minecraftminecraft-pingminecraft-queryphppingquery

### Embed Badge

![Health badge](/badges/php-minecraft-minecraft-query/health.svg)

```
[![Health](https://phpackages.com/badges/php-minecraft-minecraft-query/health.svg)](https://phpackages.com/packages/php-minecraft-minecraft-query)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k13](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
