{"id":19651860,"url":"https://github.com/jgniecki/mcpack","last_synced_at":"2026-04-10T10:03:36.491Z","repository":{"id":62502718,"uuid":"279561958","full_name":"jgniecki/MCPack","owner":"jgniecki","description":"🐘 The library is designed to integrate the minecraft server with the website","archived":false,"fork":false,"pushed_at":"2024-07-26T19:17:38.000Z","size":55,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-01T12:22:39.797Z","etag":null,"topics":["console","devlancer","lib","library","mc","mcpack","minecraft","minecraft-console","minecraft-motd","minecraft-query","minecraft-rcon","minecraft-server","motd","pack","package","query","rcon","server","website","www"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/dev-lancer/mc-pack","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}},"created_at":"2020-07-14T11:06:16.000Z","updated_at":"2025-10-02T17:04:39.000Z","dependencies_parsed_at":"2024-12-20T20:48:11.348Z","dependency_job_id":null,"html_url":"https://github.com/jgniecki/MCPack","commit_stats":null,"previous_names":["developerlancer/mcpack"],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/jgniecki/MCPack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgniecki%2FMCPack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgniecki%2FMCPack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgniecki%2FMCPack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgniecki%2FMCPack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jgniecki","download_url":"https://codeload.github.com/jgniecki/MCPack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgniecki%2FMCPack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31637749,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["console","devlancer","lib","library","mc","mcpack","minecraft","minecraft-console","minecraft-motd","minecraft-query","minecraft-rcon","minecraft-server","motd","pack","package","query","rcon","server","website","www"],"created_at":"2024-11-11T15:08:18.693Z","updated_at":"2026-04-10T10:03:36.450Z","avatar_url":"https://github.com/jgniecki.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP MCPack [![Packagist](https://img.shields.io/packagist/dt/dev-lancer/mc-pack.svg)](https://packagist.org/packages/dev-lancer/mc-pack)\n\n## Installation\nThis library can installed by issuing the following command:\n```bash\ncomposer require dev-lancer/mc-pack\n```\n\n### Query\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### Rcon\nThis method allows you to send commands, it is used in item shop, and requires enabling `rcon` listener in your `server.properties` like this:\n\n\u003e *enable-rcon=true*\u003cbr\u003e\n\u003e *rcon.port=25575*\u003cbr\u003e\n\u003e *rcon.password=pass*\n\n## Example\n### Query \u0026 Rcon\n\nIt enables downloading basic server information and sending commands.\n\n```php\n\u003c?php\n    require 'vendor/autoload.php';\n    \n    use DevLancer\\MCPack\\ConsoleRcon;\n    use DevLancer\\MinecraftStatus\\Query;\n\n    $info = new Query(\"some.minecraftserver.com\", 25565);\n    $info-\u003econnect();\n    \n    $console = new ConsoleRcon(\"some.minecraftserver.com\", 25575, \"pass\", 3);\n    $console-\u003econnect();\n\n    $players = $info-\u003egetCountPlayers();\n    echo $players . \"/\" . $info-\u003egetMaxPlayers();\n\n    $console-\u003esendCommand(\"bc MCPack\");\n```\n\nLook [here](https://github.com/jgniecki/MinecraftStatus) for Query\n\nLook [here](https://github.com/jgniecki/MinecraftRcon) for RCON\n\n### ServerManager with SSH\n\nIt enables downloading basic server information, sending commands and server management.\n\n```php\n\u003c?php\n    require 'vendor/autoload.php';\n    \n    use DevLancer\\MCPack\\ConsoleRcon;\n    use DevLancer\\MCPack\\Manager\\ServerManager;\n    use DevLancer\\MCPack\\Sftp\\Sftp;\n\n    $host = \"some.minecraftserver.com\";\n    $sftp = new Sftp($host);\n    $sftp-\u003elogin(\"username\", \"password\");\n\n    $server = new ServerManager($sftp, 25565);\n\n    $path = \"path/to/minecraft/server.jar\";\n    if(!$server-\u003eisRunning()) {\n        if ($server-\u003erun([\"-Xmx1G\"], $path))\n            echo \"server started\";\n    }\n```\n\n### Server logs\n\nThis class allows downloading logs from the server.\n\n```php\n\u003c?php\n    require 'vendor/autoload.php';\n    \n    use DevLancer\\MCPack\\Logs;\n    use DevLancer\\MCPack\\Sftp\\Sftp;\n\n    $host = \"some.minecraftserver.com\";\n    $sftp = new Sftp($host);\n    $sftp-\u003elogin(\"username\", \"password\");\n\n    $path = \"path/to/minecraft/logs/latest.log\";\n    $logs = new Logs($sftp, $path);\n    echo implode(\"\u003cbr /\u003e\", $logs-\u003egetLogs(true));\n```\n\n### Properties\n\n```php\n\u003c?php\n    require 'vendor/autoload.php';\n    \n    use DevLancer\\MCPack\\Manager\\PropertiesManager;\n    use DevLancer\\MCPack\\Sftp\\Sftp;\n\n    $sftp = new Sftp(\"some.minecraftserver.com\");\n    $sftp-\u003elogin(\"username\", \"password\");\n    \n    $manager = new PropertiesManager(\"path/to/minecraft/server.properties\", $sftp);\n    $properties = $manager-\u003egetProperties();\n    $properties-\u003esetRconPassword(\"new-password\");\n    $manager-\u003esaveProperties($properties);\n```\n\n### Motd\n\n```php\n\u003c?php\n    require 'vendor/autoload.php';\n    \n    use DevLancer\\MCPack\\Motd;\n    use DevLancer\\MinecraftStatus\\Ping;\n\n    $host = \"some.minecraftserver.com\";\n    $info = new Ping($host, 25565);\n    $info-\u003econnect();\n    \n    $motd = new Motd($info);\n    $motd-\u003esendRequest();\n    \n    echo $motd-\u003egetResponse(Motd::RESPONSE_HTML);\n```\n\nLook [here](https://github.com/jgniecki/MinecraftMotdParser)\n\n## License\n[MIT](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgniecki%2Fmcpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjgniecki%2Fmcpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgniecki%2Fmcpack/lists"}