{"id":15068520,"url":"https://github.com/php-minecraft/minecraftquery","last_synced_at":"2025-04-10T17:43:29.335Z","repository":{"id":57039918,"uuid":"197645168","full_name":"PHP-Minecraft/MinecraftQuery","owner":"PHP-Minecraft","description":"🛰️ Minecraft PHP library for retrieving server query data","archived":false,"fork":false,"pushed_at":"2022-11-27T18:45:13.000Z","size":14,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-02-23T04:20:25.047Z","etag":null,"topics":["minecraft","minecraft-ping","minecraft-query","php","ping","query"],"latest_commit_sha":null,"homepage":"","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/PHP-Minecraft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-18T19:28:00.000Z","updated_at":"2022-11-14T00:15:56.000Z","dependencies_parsed_at":"2022-08-23T23:30:27.270Z","dependency_job_id":null,"html_url":"https://github.com/PHP-Minecraft/MinecraftQuery","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHP-Minecraft%2FMinecraftQuery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHP-Minecraft%2FMinecraftQuery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHP-Minecraft%2FMinecraftQuery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHP-Minecraft%2FMinecraftQuery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PHP-Minecraft","download_url":"https://codeload.github.com/PHP-Minecraft/MinecraftQuery/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239343358,"owners_count":19623228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["minecraft","minecraft-ping","minecraft-query","php","ping","query"],"created_at":"2024-09-25T01:37:55.615Z","updated_at":"2025-02-17T18:31:26.317Z","avatar_url":"https://github.com/PHP-Minecraft.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MinecraftQuery\n🛰️ Minecraft PHP library for retrieving server query data\n\n# Installation\nRequired at least PHP 7.2\n```\ncomposer require php-minecraft/minecraft-query\n```\n\n# Example usage\n\n```PHP\ndeclare(strict_types=1);\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse PHPMinecraft\\MinecraftQuery\\MinecraftQueryResolver;\n```\n\n## Minecraft v1.7+\n```PHP\n$resolver = new MinecraftQueryResolver('play.minecord.net', 25565);\n\n$result = $resolver-\u003egetResult();\n\n```\n\n## Minecraft \u003c= v1.6\n```PHP\n$resolver = new MinecraftQueryResolver('play.minecord.net', 25565);\n\n$resolver-\u003eretrieveDataPre17();\n\n$result = $resolver-\u003egetResult();\n\n```\n\n## Autodetect minecraft version (if 1.7+ query fails, older will be used)\n```PHP\n$resolver = new MinecraftQueryResolver('play.minecord.net', 25565);\n\n$result = $resolver-\u003egetResult($tryOldQueryProtocolPre17 = true);\n\n```\n\n## Result data\n```PHP\n$result-\u003egetMaxPlayers() // integer\n$result-\u003egetOnlinePlayers() // integer\n$result-\u003egetPlayersSample() // array (players -\u003e sample at https://wiki.vg/Server_List_Ping)\n$result-\u003egetVersion() // string\n$result-\u003egetProtocolVersion() // integer\n$result-\u003egetMessageOfTheDay() // string\n$result-\u003egetLatency() // integer (ms)\n$result-\u003egetFavicon() // string or null\n```\n\n\n## Tweaks\n```PHP\n// use this cosntructor if you dont want separate address to host and port\n$resolver = MinecraftQueryResolver::fromAddress('play.minecord.net');\n\n// use this method if you want raw data in array retrieved from minecraft server\n$rawData = $resolver-\u003egetRawData();\n\n// use this method if you want construct MinecraftQueryResult from raw data\n$result = MinecraftQueryResult::fromRawData($rawData);\n```\n\nLibrary (socket logic) is inspired by xPaw/PHP-Minecraft-Query\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-minecraft%2Fminecraftquery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphp-minecraft%2Fminecraftquery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-minecraft%2Fminecraftquery/lists"}