{"id":20027011,"url":"https://github.com/defective4/minelite","last_synced_at":"2025-05-05T02:31:28.174Z","repository":{"id":59926609,"uuid":"539896577","full_name":"Defective4/MineLite","owner":"Defective4","description":"A lightweight library to interact with Minecraft protocol.","archived":false,"fork":false,"pushed_at":"2022-10-17T16:56:52.000Z","size":241,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-01T17:25:25.330Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/Defective4.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}},"created_at":"2022-09-22T09:17:39.000Z","updated_at":"2023-05-07T19:37:52.000Z","dependencies_parsed_at":"2022-09-25T08:00:51.187Z","dependency_job_id":null,"html_url":"https://github.com/Defective4/MineLite","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Defective4%2FMineLite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Defective4%2FMineLite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Defective4%2FMineLite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Defective4%2FMineLite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Defective4","download_url":"https://codeload.github.com/Defective4/MineLite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224420074,"owners_count":17308065,"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":[],"created_at":"2024-11-13T09:08:47.700Z","updated_at":"2024-11-13T09:08:48.227Z","avatar_url":"https://github.com/Defective4.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MineLite\nMineLite is a lightweight library used for interacting with Minecraft servers. \u003cbr\u003e\nWith it you can build simple Minecraft chat bots or get status of a server.\n\n# Fetures\n- Server List Ping - ping a server to receive its data\n- Minecraft Client - create custom Minecraft bots with (almost) full chat support, many pre-implemented packets (and many more to come), with minimum effort!\n\n## Using in your project\n### Maven\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.github.defective4\u003c/groupId\u003e\n  \u003cartifactId\u003eminelite-protocol-(your Minecraft version)\u003c/artifactId\u003e\n  \u003cversion\u003e0.9\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Gradle\n```\n repositories {\n \tmaven {\n \t\turl \"https://s01.oss.sonatype.org/content/repositories/releases\"\n \t}\n }\n \n dependencies {\n \timplementation \"io.github.defective4:minelite-protocol-(your Minecraft version):0.9\"\n }\n```\n\nAlternatively you can download binaries and javadoc from [Releases](https://github.com/Defective4/MineLite/releases) page. \u003cbr\u003e\nNote that you will need both minelite-core-x.x.jar and minelite-protocol-(Minecraft version)-x.x.jar to create a custom client.\n\n## Currently supported versions\n- 1.18.2\n- 1.12.2\n\n## Examples\n### Server List Ping\n#### Code\n```\ntry {\n    StatusResponse response = MinecraftStat.ping(\"localhost\", 25565);\n    System.out.println(\"Description: \" + response.getDescription());\n    System.out.println(\"Players: \" + response.getOnlinePlayers() + \"/\" + response.getMaxPlayers());\n    System.out.println(\"Version: \" + response.getVersionName() + \"(\" + response.getProtocolNumber() + \")\");\n} catch (Exception ex) {\n    ex.printStackTrace();\n}\n```\n\n#### Example Output\n```\nDescription: A Minecraft Server\nPlayers: 1/20\nVersion: Spigot 1.12.2 (340)\n````\n\n### Joining a server (1.18.2)\n#### Code\n```\nString host = \"localhost\";\nint port = 25565;\nString username = \"Username\";\ntry (MinecraftClient client = new MinecraftClient(host, port, username, new Protocol_1_18_2())) {\n    client.addClientListener(new ClientAdapter() {\n\n    @Override\n    public void messageReceived(Message message, int position, UUID sender) {\n        System.out.println(message.getText());\n    }\n\n    @Override\n    public void disconnected(Message message) {\n        System.err.println(\"I couldn't connect: \" + message.getText());\n    }\n\n    @Override\n    public void joined(int entityID) {\n        System.out.println(\"I have joined the server!\");\n        try {\n           client.sendMessage(\"Hello World!\");\n        } catch (Exception ex) {\n            ex.printStackTrace();\n        }\n    }\n\n    });\n    client.connect();\n} catch (Exception ex) {\n    ex.printStackTrace();\n}\n```\n\nThis code will join the specified server (localhost:25565) under nick \"Username\", say \"Hello World!\" after successfully joining and will stay there until you disconnect it. \u003cbr\u003e\nIt will also log all received messages to standard output.\n\n## Building\nTo build this library from source clone it using git and then run:\n```\nmvn clean install\n```\nin the minelite directory.\n\n## TODO\n- [ ] - Server List Ping icon and players sample support \u003cbr\u003e\n- [ ] - Messages click and hover events, and color + formatting support \u003cbr\u003e\n- [ ] - More Minecraft versions (priorities: 1.12.2, 1.16.5, 1.8) \u003cbr\u003e\n- [ ] - More packets (inventory, world, movement) \u003cbr\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefective4%2Fminelite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefective4%2Fminelite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefective4%2Fminelite/lists"}