# QMinecraft **Repository Path**: byusistudio/qminecraft ## Basic Information - **Project Name**: QMinecraft - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-22 - **Last Updated**: 2026-03-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # QMinecraft QMinecraft 是一个用 Go 语言编写的 Minecraft 服务器查询工具,支持 Java 版和基岩版服务器的查询。 ## 功能特性 - **多版本支持**: 支持 Minecraft Java Edition 和 Bedrock Edition 服务器查询 - **DNS 解析**: 内置 DNS 解析器,支持缓存功能 - **HTTP API**: 提供 HTTP 接口用于查询服务器信息 - **CGO 库**: 提供 C 语言绑定,方便其他语言调用 - **数据格式化**: 自动格式化查询结果为统一的 JSON 响应 ## 项目结构 ``` qminecraft/ ├── cmd/ │ ├── lib/ # CGO 动态库 │ └── server/ # HTTP 服务器 ├── config/ # 配置管理 ├── internal/ │ ├── dns/ # DNS 解析器 │ ├── formatter/ # 响应格式化 │ ├── handler/ # HTTP 处理器 │ └── query/ # 服务器查询 └── pkg/ └── models/ # 数据模型 ``` ## 安装 ### 从源码编译 ```bash git clone https://gitee.com/byusistudio/qminecraft.git cd qminecraft go build -o qminecraft ./cmd/server ``` ## 使用方法 ### CGO 库 如果你需要在自己的程序中调用: ```c #include #include // 查询 Java 版服务器 char* result = QueryJava("mc.hypixel.net", 25565); // 查询基岩版服务器 // char* result = QueryBedrock("mc.hypixel.net", 19132); printf("%s\n", result); FreeString(result); ``` ## 响应格式 ### Java 版服务器响应 ```json { "status": "success", "queryType": "java", "queryTimeMs": 10.5, "host": "mc.hypixel.net", "port": 25565, "serverInfo": { "version": { "name": "Paper 1.20.4", "protocol": 765 }, "players": { "online": 1000, "max": 2000, "sample": [] }, "description": "§aHypixel §c- §aSkyblock" }, "modInfo": { "type": "forge", "modList": [] } } ``` ### 基岩版服务器响应 ```json { "status": "success", "queryType": "bedrock", "queryTimeMs": 5.2, "host": "mc.hypixel.net", "port": 19132, "serverInfo": { "edition": "MCPE", "name": "§aHypixel §c- §aSkyblock", "protocol": 622, "version": "1.20.40", "players": { "online": 1000, "max": 2000 }, "gamemode": "Survival", "serverId": "123456789" } } ``` ## 贡献指南 欢迎提交 Issue 和 Pull Request! ## 相关链接 - [Gitee 仓库](https://gitee.com/byusistudio/qminecraft) - [Minecraft 协议文档](https://wiki.vg/Protocol) - [Minecraft Bedrock 协议文档](https://wiki.vg/Bedrock_Protocol)