OneBot
一个强大的 Minecraft 服务器插件,将 OneBot 协议实现与你的游戏服务器连接起来。
Wiki | Issues
✨ 特性
- ? 协议支持 - 完整支持 OneBot v11/v12 协议
- ? 广泛兼容性 - 适用于 Minecraft 1.8-1.21+ 服务器
- ? 高性能 - 基于 TabooLib 框架构建,实现最佳性能
- ? 易于配置 - 提供针对流行 OneBot 实现的预配置模板
- ? 指标集成 - 内置 bStats 指标以进行使用分析
- ? 国际化 - 通过 i18n 支持多语言
- ? 实时同步 - 游戏与聊天平台之间的双向消息转发
- ? 富文本支持 - 完整的 Minecraft 聊天组件支持及格式化
? 要求
- Java: 8 或更高版本
- Server: Bukkit/Spigot/Paper 1.8-1.21+
- 内存: 推荐最低 2GB
- OneBot 实现: 任何兼容 OneBot v11/v12 的服务器(例如 go-cqhttp、Lagrange.OneBot)
? 快速开始
安装
-
下载插件
-
在服务器上安装
# 将 JAR 文件放入服务器的 plugins 目录
cp OneBot-*.jar /path/to/server/plugins/
-
启动/重启服务器
# 重启你的 Minecraft 服务器
/reload
# 或者
/stop && ./start.sh
配置
-
列出可用预设
/onebot preset list
-
应用预设配置
# 对于 go-cqhttp
/onebot preset apply go-cqhttp
# 对于 Lagrange.OneBot
/onebot preset apply lagrange
-
连接到 OneBot 服务器
/onebot connect
-
检查连接状态
/onebot status
? 项目结构
OneBot/
├── src/
│ └── main/
│ ├── kotlin/ # Kotlin 源代码
│ └── resources/ # 资源文件
│ ├── config.yml # 主配置文件
│ └── lang/ # 语言文件
├── build.gradle.kts # 构建配置
└── settings.gradle.kts # 项目设置
? 开发
从源码构建
# 克隆仓库
git clone https://github.com/BingZi-233/OneBot.git
cd OneBot
# 构建插件
./gradlew build
# 输出的 JAR 文件将在 build/libs/ 中
开发环境设置
对于希望将 OneBot 作为依赖项使用的开发者:
# 构建 API JAR(不包含实现代码)
./gradlew taboolibBuildApi -PDeleteCode
Maven 依赖
<dependency>
<groupId>online.bingzi</groupId>
<artifactId>onebot</artifactId>
<version>VERSION</version>
</dependency>
Gradle 依赖
dependencies {
implementation("online.bingzi:onebot:VERSION")
}
? 支持的 OneBot 实现
| 实现名称 |
协议版本 |
状态 |
| go-cqhttp |
v11 |
✅ 完全支持 |
| Lagrange.OneBot |
v11 |
✅ 完全支持 |
| Shamrock |
v11 |
✅ 完全支持 |
| NapCat |
v11 |
✅ 完全支持 |
| OneBot v12 |
v12 |
? 开发中 |
? 命令
| 命令 |
权限 |
描述 |
/onebot help |
onebot.use |
显示帮助信息 |
/onebot status |
onebot.use |
检查连接状态 |
/onebot connect |
onebot.admin |
连接到 OneBot 服务器 |
/onebot disconnect |
onebot.admin |
断开与 OneBot 服务器的连接 |
/onebot reload |
onebot.admin |
重新加载配置 |
/onebot preset list |
onebot.admin |
列出可用预设 |
/onebot preset apply <name> |
onebot.admin |
应用预设配置 |
? 配置指南
基础配置
# config.yml
onebot:
# 连接设置
connection:
type: websocket
host: localhost
port: 8080
path: /onebot/v11/ws
# 认证
auth:
enabled: false
token: your-token-here
# 消息转发
forward:
game-to-bot: true
bot-to-game: true
# 格式设置
format:
game-message: "[MC] <{player}> {message}"
bot-message: "[QQ] <{sender}> {message}"
高级设置
有关详细的配置选项,请参阅 Configuration Wiki。
? 贡献
我们欢迎贡献!详情请参阅我们的 Contributing Guidelines。
- Fork 本仓库
- 创建你的功能分支 (
git checkout -b feature/AmazingFeature)
- 提交你的更改 (
git commit -m 'Add some AmazingFeature')
- 推送到分支 (
git push origin feature/AmazingFeature)
- 打开 Pull Request
? 指标
本插件使用 bStats 收集匿名使用数据。你可以在 bStats 配置文件中选择不加入统计。
查看我们的指标数据:bStats Page
? Bug 报告与功能请求
? 许可证
本项目遵循 MIT 许可证授权 - 详情请参阅 LICENSE 文件。
? 致谢
? 支持
如果您觉得本插件有帮助,请考虑:
- ⭐ 给仓库点星(Star)
- ? 报告错误并提出功能建议
- ? 为代码库做出贡献
- ? 分享给他人
OneBot
A powerful Minecraft server plugin that bridges OneBot protocol implementations with your game server.
Wiki | Issues
✨ Features
- ? Protocol Support - Full support for OneBot v11/v12 protocols
- ? Wide Compatibility - Works with Minecraft 1.8-1.21+ servers
- ? High Performance - Built on TabooLib framework for optimal performance
- ? Easy Configuration - Pre-configured templates for popular OneBot implementations
- ? Metrics Integration - Built-in bStats metrics for usage analytics
- ? Internationalization - Multi-language support with i18n
- ? Real-time Sync - Bidirectional message forwarding between game and chat platforms
- ? Rich Text Support - Full Minecraft chat component support with formatting
? Requirements
- Java: 8 or higher
- Server: Bukkit/Spigot/Paper 1.8-1.21+
- Memory: Minimum 2GB recommended
- OneBot Implementation: Any OneBot v11/v12 compatible server (e.g., go-cqhttp, Lagrange.OneBot)
? Quick Start
Installation
-
Download the Plugin
- Get the latest release from Releases
- Choose the file:
OneBot-x.x.x.jar
-
Install on Server
# Place the JAR file in your server's plugins directory
cp OneBot-*.jar /path/to/server/plugins/
-
Start/Restart Server
# Restart your Minecraft server
/reload
# or
/stop && ./start.sh
Configuration
-
List Available Presets
/onebot preset list
-
Apply a Preset Configuration
# For go-cqhttp
/onebot preset apply go-cqhttp
# For Lagrange.OneBot
/onebot preset apply lagrange
-
Connect to OneBot Server
/onebot connect
-
Check Connection Status
/onebot status
? Project Structure
OneBot/
├── src/
│ └── main/
│ ├── kotlin/ # Kotlin source code
│ └── resources/ # Resource files
│ ├── config.yml # Main configuration
│ └── lang/ # Language files
├── build.gradle.kts # Build configuration
└── settings.gradle.kts # Project settings
? Development
Building from Source
# Clone the repository
git clone https://github.com/BingZi-233/OneBot.git
cd OneBot
# Build the plugin
./gradlew build
# The output JAR will be in build/libs/
Development Setup
For developers who want to use OneBot as a dependency:
# Build API JAR (without implementation)
./gradlew taboolibBuildApi -PDeleteCode
Maven Dependency
<dependency>
<groupId>online.bingzi</groupId>
<artifactId>onebot</artifactId>
<version>VERSION</version>
</dependency>
Gradle Dependency
dependencies {
implementation("online.bingzi:onebot:VERSION")
}
? Supported OneBot Implementations
| Implementation |
Protocol Version |
Status |
| go-cqhttp |
v11 |
✅ Fully Supported |
| Lagrange.OneBot |
v11 |
✅ Fully Supported |
| Shamrock |
v11 |
✅ Fully Supported |
| NapCat |
v11 |
✅ Fully Supported |
| OneBot v12 |
v12 |
? In Development |
? Commands
| Command |
Permission |
Description |
/onebot help |
onebot.use |
Show help information |
/onebot status |
onebot.use |
Check connection status |
/onebot connect |
onebot.admin |
Connect to OneBot server |
/onebot disconnect |
onebot.admin |
Disconnect from OneBot server |
/onebot reload |
onebot.admin |
Reload configuration |
/onebot preset list |
onebot.admin |
List available presets |
/onebot preset apply <name> |
onebot.admin |
Apply a preset configuration |
? Configuration Guide
Basic Configuration
# config.yml
onebot:
# Connection settings
connection:
type: websocket
host: localhost
port: 8080
path: /onebot/v11/ws
# Authentication
auth:
enabled: false
token: your-token-here
# Message forwarding
forward:
game-to-bot: true
bot-to-game: true
# Format settings
format:
game-message: "[MC] <{player}> {message}"
bot-message: "[QQ] <{sender}> {message}"
Advanced Settings
See Configuration Wiki for detailed configuration options.
? Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature)
- Commit your changes (
git commit -m 'Add some AmazingFeature')
- Push to the branch (
git push origin feature/AmazingFeature)
- Open a Pull Request
? Metrics
This plugin uses bStats to collect anonymous usage data. You can opt-out in the bStats config file.
View our metrics: bStats Page
? Bug Reports & Feature Requests
? License
This project is licensed under the MIT License - see the LICENSE file for details.
? Acknowledgments
- cnlimiter/onebot-client - This project is redesigned and reimplemented based on this project
- TabooLib - The powerful framework this plugin is built on
- OneBot - The chat protocol standard
- All contributors and users of this plugin
? Support
If you find this plugin helpful, please consider:
- ⭐ Starring the repository
- ? Reporting bugs and suggesting features
- ? Contributing to the codebase
- ? Sharing with others
评论 0
登录后参与评分
还没有评论,来抢沙发吧