{"id":18751084,"url":"https://github.com/sch8ill/mclib","last_synced_at":"2025-04-13T00:08:38.136Z","repository":{"id":200054392,"uuid":"705054643","full_name":"Sch8ill/mclib","owner":"Sch8ill","description":"A Minecraft client to retrieve status information via the SLP protocol","archived":false,"fork":false,"pushed_at":"2025-03-31T20:32:50.000Z","size":2017,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T00:08:30.616Z","etag":null,"topics":["golang","minecraft-client","minecraft-mod","minecraft-ping","minecraft-protocol","minecraft-slp"],"latest_commit_sha":null,"homepage":"","language":"Go","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/Sch8ill.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":"2023-10-14T22:50:59.000Z","updated_at":"2025-03-31T20:29:14.000Z","dependencies_parsed_at":"2024-03-20T18:38:26.652Z","dependency_job_id":"86bda783-d2b0-40ff-a44e-880a70b16c00","html_url":"https://github.com/Sch8ill/mclib","commit_stats":null,"previous_names":["sch8ill/mclib"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sch8ill%2Fmclib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sch8ill%2Fmclib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sch8ill%2Fmclib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sch8ill%2Fmclib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sch8ill","download_url":"https://codeload.github.com/Sch8ill/mclib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647299,"owners_count":21139086,"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":["golang","minecraft-client","minecraft-mod","minecraft-ping","minecraft-protocol","minecraft-slp"],"created_at":"2024-11-07T17:14:21.744Z","updated_at":"2025-04-13T00:08:38.117Z","avatar_url":"https://github.com/Sch8ill.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mclib\n\n[![Release](https://img.shields.io/github/release/sch8ill/mclib.svg?style=flat-square)](https://github.com/sch8ill/mclib/releases)\n[![doc](https://img.shields.io/badge/go.dev-doc-007d9c?style=flat-square\u0026logo=read-the-docs)](https://pkg.go.dev/github.com/sch8ill/mclib)\n[![Go Report Card](https://goreportcard.com/badge/github.com/sch8ill/mclib)](https://goreportcard.com/report/github.com/sch8ill/mclib)\n![MIT license](https://img.shields.io/badge/license-MIT-green)\n\n---\n\nThe `mclib` package provides utilities for interacting with Minecraft servers using\nthe [Minecraft protocol](https://wiki.vg/Protocol).\nIt includes functionality to query Minecraft servers for status and latency information.\n`mclib` is also capable of determining the software a server is running on by using fingerprinting techniques.\n\n---\n\n## Installation\n\nTo use this package in your Go project, simply install it:\n\n```bash\ngo get github.com/sch8ill/mclib\n```\n\n## Usage\n\n### StatusPing\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/sch8ill/mclib\"\n)\n\nfunc main() {\n\tclient, _ := mclib.NewClient(\"2b2t.org\")\n\tres, _ := client.StatusPing()\n\n\tfmt.Printf(\"version: %s\\n\", res.Version.Name)\n\tfmt.Printf(\"protocol: %d\\n\", res.Version.Protocol)\n\tfmt.Printf(\"online players: %d\\n\", res.Players.Online)\n\tfmt.Printf(\"max players: %d\\n\", res.Players.Max)\n\tfmt.Printf(\"sample players: %+q\\n\", res.Players.Sample)\n\tfmt.Printf(\"description: %s\\n\", res.Description.String())\n\tfmt.Printf(\"latency: %dms\\n\", res.Latency)\n}\n```\n\n#### output\n\n```text\nversion: Velocity 1.7.2-1.20.4\nprotocol: 47\nonline players: 571\nmax players: 1\nsample players: [{\"Fit\" \"fdee323e-7f0c-4c15-8d1c-0f277442342a\"}]\ndescription: 2B Updated to 1.19! 2T\nlatency: 8ms\n```\n\n### Fingerprint\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/sch8ill/mclib/fingerprint\"\n)\n\nfunc main() {\n\tsoftware, _ := fingerprint.Fingerprint(\"localhost\")\n\tfmt.Printf(\"software fingerprint: %s\\n\", software)\n}\n```\n\n#### output\n\n```text\nsoftware fingerprint: craftbukkit\n```\n\nFurther documentation can be found on [pkg.go.dev](https://pkg.go.dev/github.com/sch8ill/mclib).\n\n---\n\n### Cli\n\n#### Build\n\nrequires:\n\n```\nmake\ngo \u003e= 1.22\n```\n\n```bash\nmake build\n```\n\n#### Usage\n\n`mclib` also provides a simple command line interface:\n\n```\n  -addr string\n        the server address (default \"localhost\")\n  -fingerprint\n        whether a software fingerprint should be performed on the server (default true)\n  -protocol int\n        the protocol version number the client should use (default 760)\n  -srv\n        whether a srv lookup should be made (default true)\n  -timeout duration\n        the connection timeout (default 5s)\n```\n\nFor example:\n\n```bash\nmcli --addr hypixel.net --timeout 10s\n```\n\n---\n\n## License\n\nThis package is licensed under the [MIT License](LICENSE).\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsch8ill%2Fmclib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsch8ill%2Fmclib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsch8ill%2Fmclib/lists"}