{"id":15296404,"url":"https://github.com/jgniecki/minecraftstatus","last_synced_at":"2026-05-31T01:01:16.585Z","repository":{"id":56966203,"uuid":"354799903","full_name":"jgniecki/MinecraftStatus","owner":"jgniecki","description":"🐘 PHP library to query Minecraft servers","archived":false,"fork":false,"pushed_at":"2026-05-30T09:53:06.000Z","size":147,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"3.0","last_synced_at":"2026-05-30T11:22:54.566Z","etag":null,"topics":["bedrock","bedrock-edition","mc","mcpe","minecraft","php","php74","ping","protocol","query","raknet","status"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/dev-lancer/minecraft-status","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jgniecki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-04-05T10:40:28.000Z","updated_at":"2025-08-12T19:34:53.000Z","dependencies_parsed_at":"2023-12-15T14:29:24.149Z","dependency_job_id":"5bfbd9a8-c5b5-406d-9a42-14810a054bcb","html_url":"https://github.com/jgniecki/MinecraftStatus","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"108acd6ab3f5ded3a40c3988baa9a10576725f6a"},"previous_names":["developerlancer/minecraftstatus"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/jgniecki/MinecraftStatus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgniecki%2FMinecraftStatus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgniecki%2FMinecraftStatus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgniecki%2FMinecraftStatus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgniecki%2FMinecraftStatus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jgniecki","download_url":"https://codeload.github.com/jgniecki/MinecraftStatus/tar.gz/refs/heads/3.0","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgniecki%2FMinecraftStatus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33715211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bedrock","bedrock-edition","mc","mcpe","minecraft","php","php74","ping","protocol","query","raknet","status"],"created_at":"2024-09-30T18:10:22.809Z","updated_at":"2026-05-31T01:01:16.568Z","avatar_url":"https://github.com/jgniecki.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Minecraft Status\n![](https://img.shields.io/packagist/l/dev-lancer/minecraft-status?style=for-the-badge)\n![](https://img.shields.io/packagist/dt/dev-lancer/minecraft-status?style=for-the-badge)\n![](https://img.shields.io/github/v/release/DeveloperLancer/MinecraftStatus?style=for-the-badge)\n![](https://img.shields.io/packagist/php-v/dev-lancer/minecraft-status?style=for-the-badge)\n\nMinecraftStatus library allows you to communicate with minecraft servers using the most popular protocols.\n\n## Installation\nThis library can be installed by issuing the following command:\n```bash\ncomposer require dev-lancer/minecraft-status\n```\n\n## Differences between MinecraftJavaStatus and MinecraftJavaQuery\n\n### MinecraftJavaStatus\nMinecraftJavaStatus uses the TCP protocol to communicate with the Minecraft server in the java edition and bedrock edition, it uses the port on which the server is running.\nPing provides the most necessary information (hostname, motd, favicon, and a sample of players).\nThanks to its simplicity, it does not require any configuration on the server side, communication works with servers from version 1.7 and above.\n\nTo communicate with a server which has a version lower than 1.7, use the `MinecraftJavaPreOld17Status` class\n\nFor bedrock edition servers use class `MinecraftBedrockStatus`\n\n\n### MinecraftJavaQuery\nMinecraftJavaQuery uses GameSpy 4 protocol for communication,\nso you should start listening in the server properties.\nQuery allows you to request more information about the server,\nbut has more security vulnerabilities.\n\n## Usage\n\n### Minecraft Java Edition server with Query\n\nExample: [MinecraftJavaQuery](examples/query.php)\n\nThis method uses GameSpy4 protocol, and requires enabling `query` listener in your `server.properties` like this:\n\n\u003e *enable-query=true*\u003cbr\u003e\n\u003e *query.port=25565*\n\n```php\n\u003c?php\nuse \\DevLancer\\MinecraftStatus\\MinecraftJavaQuery;\n\nrequire_once (\"vendor/autoload.php\");\n\n$host = \"\"; //Address server minecraft\n$port = 25565; //from query.port\n$timeout = 3;\n$resolveSVR = true;\n\n$query = new MinecraftJavaQuery($host, $port, $timeout, $resolveSVR);\n$query-\u003econnect();\nprint_r($query-\u003egetInfo());\n```\n\n### Minecraft Bedrock Edition server status\n\nExample: [MinecraftBedrockStatus](examples/bedrock.php)\n\nUse this class for bedrock edition servers\n\nIn QueryBedrock you do not need to set anything in the properties of the server,\nthe port on which the server runs is used to communicate with the server\n\n```php\n\u003c?php\nuse \\DevLancer\\MinecraftStatus\\MinecraftBedrockStatus;\n\nrequire_once (\"vendor/autoload.php\");\n\n$host = \"\"; //Address server minecraft\n$port = 19132;\n$timeout = 3;\n$resolveSVR = true;\n\n$query = new MinecraftBedrockStatus($host, $port, $timeout, $resolveSVR);\n$query-\u003econnect();\nprint_r($query-\u003egetInfo());\n```\n\n### Minecraft Java Edition server status\n\nExample: [MinecraftJavaStatus](examples/ping.php)\n\n```php\n\u003c?php\nuse \\DevLancer\\MinecraftStatus\\MinecraftJavaStatus;\nuse \\DevLancer\\MinecraftStatus\\MinecraftJavaPreOld17Status;\n\nrequire_once (\"vendor/autoload.php\");\n\n$host = \"\"; //Address server minecraft\n$port = 25565;\n$timeout = 3;\n$resolveSVR = true;\n\n$ping = new MinecraftJavaStatus($host, $port, $timeout, $resolveSVR);\n//$ping = new MinecraftJavaPreOld17Status($host, $port, $timeout, $resolveSVR); //use when version is older than Minecraft 1.7\n$ping-\u003econnect();\nprint_r($ping-\u003egetInfo());\n```\n\nIf you want to get `ping` info from a server that uses a version older than Minecraft 1.7, then use class `PingPreOld17` instead of `Ping`.\n\n## Methods\n\n### List of methods\n|                   | MinecraftJavaQuery | MinecraftBedrockStatus | MinecraftJavaStatus | MinecraftJavaPreOld17Status |\n|-------------------|--------------------|------------------------|---------------------|-----------------------------|\n| connect()         | X                  | X                      | X                   | X                           |\n| isConnected()     | X                  | X                      | X                   | X                           |\n| disconnect()      | X                  | X                      | X                   | X                           |\n| getPlayers()      | X                  |                        | X                   |                             |\n| getCountPlayers() | X                  | X                      | X                   | X                           |\n| getMaxPlayers()   | X                  | X                      | X                   | X                           |\n| getInfo()         | X                  | X                      | X                   | X                           |\n| getFavicon()      |                    |                        | X                   |                             |\n| getDelay()        |                    |                        | X                   |                             |\n| setTimeout()      | X                  | X                      | X                   | X                           |\n| getTimeout()      | X                  | X                      | X                   | X                           |\n| setEncoding()     | X                  | X                      | X                   | X                           |\n| getEncoding()     | X                  | X                      | X                   | X                           |\n| isResolveSRV()    | X                  | X                      | X                   | X                           |\n| getHost()         | X                  | X                      | X                   | X                           |\n| getPort()         | X                  | X                      | X                   | X                           |\n| getMotd()         | X                  | X                      | X                   | X                           |\n| getProtocol()     |                    | X                      | X                   | X                           | \n\n### Use before connecting\n\nSets the timeout for the connection\n```php\nsetTimeout(int $timeout): void\n```\n\nSets the character encoding for the returned values using the `getInfo()` and `getPlayers()` methods\n```php\nsetEncoding(string $encoding): void\n```\n\nConnects to the server.\nThere may be a `ConnectionException` which means that the connection to the server has failed\nor a `ReceiveStatusException` when the connection to the server has succeeded,\nbut the communication has not been successful.\nWhen the method is used again, it disconnects from the server and establishes a new connection\n```php\nconnect(): self\n```\n\n### Use when you are connected\n\nDisconnects the connection to the server\n```php\ndisconnect(): void\n```\n\nUsing the following methods when not connected to the server will throw a `NotConnectedException` exception,\nin case you have successfully connected to the server but the communication does not work then they will return a default value of empty\n\nIt returns a full array with the information it was able to obtain.\n```php\ngetInfo(): array\n```\n\nReturns arrays of users\n```php\ngetPlayers(): array\n```\n\nReturns the number of online players\n```php\ngetCountPlayers(): int\n```\n\nReturns the number of server slots\n```php\ngetMaxPlayers(): int\n```\n\nReturns the favicon as a string\n```php\ngetFavicon(): string\n```\n\nReturns the connection delay [ms]\n```php\ngetDelay(): int\n```\n\nReturns a motd of the server\n```php\ngetMotd(): string\n```\n\nReturns the server protocol number\n```php\ngetProtocol(): int\n```\n\n### Use independently of the connection\n\nReturns the server host\n```php\ngetHost(): string\n```\n\nReturns a port\n```php\ngetPort(): int\n```\n\nReturns the character encoding used to encode the values in the `getInfo()` and `getPlayers()` methods.\n```php\ngetEncoding(): string\n```\n\nReturns a timeout.\n```php\ngetTimeout(): int\n```\n\nReturns `true` when a successful connection to the server is made regardless of whether a `ReceiveStatusException` exception is thrown.\n```php\nisConnected(): bool\n```\n\nReturns `true` when an attempt to resolve the SRV occurs on a connection, regardless of the result.\n```php\nisResolveSRV(): bool\n```\n\n## SRV DNS record\nThe library allows automatic resolution of SRV records, by default the service is enabled, to disable it you must specify `false` in the fourth parameter of the constructor\n\n## License\n\n[MIT](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgniecki%2Fminecraftstatus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjgniecki%2Fminecraftstatus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgniecki%2Fminecraftstatus/lists"}