PHPackages                             easyx/php-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. easyx/php-minecraft-query

ActiveLibrary[API Development](/categories/api)

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

PHP library to query Minecraft servers

1.0.2(2y ago)016MITPHPPHP &gt;=8.0

Since Apr 20Pushed 1y agoCompare

[ Source](https://github.com/EasyX-Group/PHP-Minecraft-Query)[ Packagist](https://packagist.org/packages/easyx/php-minecraft-query)[ RSS](/packages/easyx-php-minecraft-query/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

PHP Minecraft Query [![Packagist](https://camo.githubusercontent.com/6efdcc4c4be7fbc890b4a3967f165503497436b59ee1b91f9d8df6fe57029e34/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f787061772f7068702d6d696e6563726166742d71756572792e737667)](https://packagist.org/packages/xpaw/php-minecraft-query)
=================================================================================================================================================================================================================================================================================================================================

[](#php-minecraft-query-)

This library can be used to query Minecraft servers for some basic information.

**⚠️ Please do not create issues when you are unable to retrieve information from a server, unless you can prove that there is a bug within the library.**

Differences between Ping and Query
----------------------------------

[](#differences-between-ping-and-query)

There are two methods of retrieving information about a Minecraft server.

### Ping

[](#ping)

Ping protocol was added in Minecraft 1.7 and is used to query the server for minimal amount of information (hostname, motd, icon, and a sample of players). This is easier to use and doesn't require extra setup on server side. It uses TCP protocol on the same port as you would connect to your server.

`MinecraftPing` class contains a method `QueryOldPre17` which can be used to query servers on version 1.6 or older.

### Query

[](#query)

This method uses GameSpy4 protocol, and requires enabling `query` listener in your `server.properties` like this:

> *enable-query=true*
> *query.port=25565*

Query allows to request a full list of servers' plugins and players, however this method is more prone to breaking, so if you don't need all this information, stick to the ping method as it's more reliable.

RCON
----

[](#rcon)

It is possible to send console commands to a Minecraft server remotely using the [Source RCON protocol](https://developer.valvesoftware.com/wiki/Source_RCON_Protocol). Use [PHP Source Query](https://github.com/xPaw/PHP-Source-Query-Class) library for your RCON needs.

SRV DNS record
--------------

[](#srv-dns-record)

This library automatically tries to resolve SRV records. If you do not wish to do so, pass `false` as the fourth param in the constructor (after timeout param).

Example
-------

[](#example)

```

```

If you want to get `ping` info from a server that uses a version older than Minecraft 1.7, then use function `QueryOldPre17` instead of `Query`.

---

If the server has query enabled (`enable-query`), then you can use `MinecraftQuery` to more retrieve information about a server.

```

```

For Bedrock servers (MCPE) use `ConnectBedrock` function instead of `Connect`, then `GetInfo` will work.

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 72.5% 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 ~9 days

Total

3

Last Release

739d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/80e86aebdddbdbda4c9967b8c157eea71f13cc1437d551d42d8338e68a352df3?d=identicon)[DontFollow](/maintainers/DontFollow)

---

Top Contributors

[![xPaw](https://avatars.githubusercontent.com/u/613331?v=4)](https://github.com/xPaw "xPaw (87 commits)")[![DontFollow](https://avatars.githubusercontent.com/u/27821679?v=4)](https://github.com/DontFollow "DontFollow (8 commits)")[![Lekensteyn](https://avatars.githubusercontent.com/u/164530?v=4)](https://github.com/Lekensteyn "Lekensteyn (6 commits)")[![beefsack](https://avatars.githubusercontent.com/u/232322?v=4)](https://github.com/beefsack "beefsack (6 commits)")[![barnumbirr](https://avatars.githubusercontent.com/u/2029239?v=4)](https://github.com/barnumbirr "barnumbirr (2 commits)")[![perry-mitchell](https://avatars.githubusercontent.com/u/3869469?v=4)](https://github.com/perry-mitchell "perry-mitchell (2 commits)")[![Wruczek](https://avatars.githubusercontent.com/u/7156344?v=4)](https://github.com/Wruczek "Wruczek (2 commits)")[![zh32](https://avatars.githubusercontent.com/u/856992?v=4)](https://github.com/zh32 "zh32 (1 commits)")[![astei](https://avatars.githubusercontent.com/u/16436212?v=4)](https://github.com/astei "astei (1 commits)")[![Erikvv](https://avatars.githubusercontent.com/u/1748197?v=4)](https://github.com/Erikvv "Erikvv (1 commits)")[![Fabrimat](https://avatars.githubusercontent.com/u/13642582?v=4)](https://github.com/Fabrimat "Fabrimat (1 commits)")[![HosfordDotMe](https://avatars.githubusercontent.com/u/555977?v=4)](https://github.com/HosfordDotMe "HosfordDotMe (1 commits)")[![South-Paw](https://avatars.githubusercontent.com/u/2154764?v=4)](https://github.com/South-Paw "South-Paw (1 commits)")[![aaronklaassen](https://avatars.githubusercontent.com/u/1580121?v=4)](https://github.com/aaronklaassen "aaronklaassen (1 commits)")

---

Tags

minecraft

###  Code Quality

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)

PHPackages © 2026

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