? AuryxDiscord - 轻量级 Minecraft-Discord 集成
AuryxDiscord 是一款轻量级、高性能的 Minecraft-Discord 集成插件,构建时未使用 JDA。它利用现代 HTTP 客户端(OkHttp + Jetty),以极低的资源消耗在您的 Minecraft 服务器和 Discord 之间提供无缝的双向通信。
✨ 主要特性
? 双向通信
- Minecraft → Discord - 通过 Webhook 发送聊天消息、事件和通知
- Discord → Minecraft - Discord 中的消息通过 HTTP 服务器显示在游戏中
- 实时同步 - 异步处理实现即时消息传递
- 无 JDA 依赖 - 仅基于 HTTP 的轻量级实现
? 服务器事件集成
- 加入/离开消息 - 玩家连接通知,支持自定义格式
- 死亡消息 - 带有死因和自定义格式的死亡通知
- 聊天同步 - 完整的聊天集成,支持 AuryxChat
- 处罚警报 - 封禁/静音/踢出通知,供管理团队使用
- 服务器状态 - 启动/关闭通知
? 丰富的格式与自定义
- Discord Embeds - 带有颜色和时间的精美富文本消息
- 玩家头像 - 通过 Minotar 自动集成玩家头颅
- 自定义格式 - 每种事件类型均可完全自定义的消息模板
- 占位符支持 - PlaceholderAPI 和 AuryxCore 占位符集成
- 表情符号支持 - ? 加入, ? 离开, ☠️ 死亡, ⚠️ 处罚
? 高级配置
- 多个 Webhook - 为聊天、日志、死亡、处罚分别设置独立频道
- 事件过滤 - 启用/禁用特定事件类型
- 消息队列 - 可配置的队列限制以防止刷屏
- HTTP 服务器 - 内置 Jetty 服务器用于 Discord → MC 通信
? 命令概览
| 命令 |
描述 |
权限 |
/auryxdiscord |
插件主命令 |
auryxdiscord.admin |
/auryxdiscord reload |
重载配置 |
auryxdiscord.reload |
/auryxdiscord test [message] |
向 Discord 发送测试消息 |
auryxdiscord.test |
/auryxdiscord info |
查看插件状态和集成信息 |
auryxdiscord.info |
? 工作原理
Minecraft → Discord 流程
- 事件检测 - 监听器捕获聊天、加入/离开、死亡事件
- 消息格式化 - 应用带有占位符的自定义模板
- Webhook 发送 - 通过 OkHttp 发送到 Discord Webhook URL
- 队列管理 - 异步处理防止服务器卡顿
Discord → Minecraft 流程
- HTTP 服务器 - 内置 Jetty 服务器接收 Discord Webhook
- 消息处理 - 解析并验证传入的 Discord 消息
- 聊天集成 - 转发到 AuryxChat 或直接广播
- 安全性 - Webhook 签名验证以确保安全
? 消息示例
Discord 通知
? **Sqrilizz** joined the server (Players: 5/20)
[MC] Sqrilizz: Hello everyone from Minecraft!
☠️ Sqrilizz was slain by Zombie
⚠️ **Admin** banned **Griefer**: Griefing spawn area
✅ **Server started** - Players can now join!
Minecraft 聊天
[Discord] DiscordUser: Hello from Discord!
[Discord] Moderator: Server restart in 5 minutes
⚙️ 配置亮点
Webhook 设置 (config.yml)
webhooks:
chat: "https://discord.com/api/webhooks/YOUR_CHAT_WEBHOOK"
log: "https://discord.com/api/webhooks/YOUR_LOG_WEBHOOK"
death: "https://discord.com/api/webhooks/YOUR_DEATH_WEBHOOK"
punishment: "https://discord.com/api/webhooks/YOUR_MOD_WEBHOOK"
事件配置
events:
join-leave: true
deaths: true
punishments: true
console: false
startup-shutdown: true
消息格式
formats:
join: "? **{player}** joined the server (Players: {online}/{max})"
leave: "? **{player}** left the server"
death: "☠️ {death_message}"
ban: "⚠️ **{staff}** banned **{player}**: {reason}"
HTTP 服务器 (Discord → MC)
server:
enabled: true
port: 8080
path: "/discord-webhook"
secret: "your-webhook-secret"
? 平台兼容性
| 平台 |
状态 |
功能 |
| Paper |
✅ 完全支持 |
所有功能可用 |
| Folia |
✅ 完全支持 |
线程安全实现 |
| Spigot |
✅ 兼容 |
核心功能正常 |
| Bukkit |
✅ 兼容 |
基本功能 |
| Purpur |
✅ 增强版 |
额外优化 |
| Velocity |
✅ 支持 |
跨服务器集成 |
? 集成与依赖
必需依赖
可选集成
开发者 API
// 获取 AuryxDiscord API
AuryxDiscordAPI api = AuryxDiscord.getAPI();
// 向 Discord 发送消息
api.sendChatMessage(player, "Hello Discord!");
api.sendLogMessage("Server event occurred");
api.sendEmbed("Title", "Description", "#5865F2");
// 检查集成状态
boolean enabled = api.isDiscordEnabled();
boolean chatSync = api.isChatEnabled();
? 性能与技术细节
轻量级架构
- 无需 JDA - 使用 OkHttp 发起 HTTP 请求(更轻量)
- 异步处理 - 所有 Discord 操作均为非阻塞式
- 智能队列 - 消息队列可防止刷屏和速率限制
- 内存高效 - 与基于机器人的解决方案相比,内存占用极低
HTTP 组件
- OkHttp 客户端 - 用于向 Discord 发送现代化、高效的 HTTP 请求
- Jetty 服务器 - 用于接收 Discord 消息的内嵌 HTTP 服务器
- Gson JSON - 用于 Webhook 负载的快速 JSON 处理
- 依赖阴影化 - 避免与其他插件发生冲突
跨版本支持
- 单 JAR 文件 - 适用于 Minecraft 1.8.8 至 1.21.10
- API 兼容性 - 适配不同的 Bukkit/Paper API 版本
- 旧版支持 - 保持与较旧服务器版本的兼容性
? 安装指南
1. 安装
- 下载 AuryxCore(必需)
- 从 Modrinth 下载 AuryxDiscord
- 将两个 JAR 文件放入
plugins/ 文件夹
- 重启服务器
2. Discord Webhook 设置
- 进入你的 Discord 服务器设置
- 导航至 集成 → Webhooks
- 为不同频道创建 webhooks:
#minecraft-chat - 用于玩家聊天消息
#server-logs - 用于加入/离开/死亡事件
#moderation - 用于处罚通知
- 将 webhook URL 复制到
config.yml
3. 配置
# 基本设置 - 只需添加你的 webhook URL
webhooks:
chat: "https://discord.com/api/webhooks/123456789/abcdefg"
log: "https://discord.com/api/webhooks/987654321/hijklmn"
# 启用所需的事件
events:
join-leave: true
deaths: true
punishments: true
# 可选:启用 Discord → Minecraft
server:
enabled: true # 允许 Discord 用户向 MC 发送消息
port: 8080
secret: "change-this-secret"
4. 测试
/auryxdiscord info # 检查集成状态
/auryxdiscord test # 向 Discord 发送测试消息
? 使用场景
? 角色扮演服务器
- 为 RP 社区提供沉浸式的 Discord 集成
- 角色死亡通知
- 工作人员管理警报
? 生存服务器
? 小游戏网络
- 通过 Velocity 实现跨服务器公告
- 锦标赛通知
- 玩家统计数据共享
?️ moderated 社区
? 高级功能
消息占位符
# 消息格式中可用的占位符:
{player} # 玩家名称
{displayname} # 玩家显示名称
{message} # 聊天消息内容
{server} # 服务器名称
{online} # 当前在线玩家数
{max} # 最大玩家数
{balance} # 玩家余额 (AuryxCore)
{death_message} # 完整死亡消息
{staff} # 工作人员名称
{reason} # 处罚原因
# PlaceholderAPI 支持:
%player_name% # 玩家名称
%server_online% # 在线人数
%auryxcore_balance% # 玩家余额
# + 1000+ 其他 PAPI 占位符
Webhook 安全性
- 签名验证 - 验证传入的 Discord webhooks
- 密钥 - 可配置的 webhook 密钥
- IP 过滤 - HTTP 服务器的可选 IP 白名单
- 速率限制 - 内置防刷屏保护
多通道设置
webhooks:
chat: "https://discord.com/api/webhooks/chat-webhook"
log: "https://discord.com/api/webhooks/log-webhook"
death: "https://discord.com/api/webhooks/death-webhook"
punishment: "https://discord.com/api/webhooks/mod-webhook"
# 事件自动路由到相应的频道
# 如果未配置特定 webhook,则回退到 'log' webhook
? 支持与社区
? 为什么选择 AuryxDiscord?
与传统 Discord 机器人对比:
- ✅ 无需托管机器人 - 直接在 Minecraft 服务器上运行
- ✅ 资源占用更低 - 无需 JDA,仅使用 HTTP 请求
- ✅ 设置更简单 - 无需机器人令牌或权限
- ✅ 更好的集成 - 直接访问服务器事件和数据
与其他 Discord 插件对比:
- ✅ 现代架构 - 专为 Paper/Folia 构建,采用异步处理
- ✅ 轻量级 - 6MB vs 基于 JDA 的插件的 20MB+
- ✅ 双向通信 - 大多数插件仅支持 MC → Discord
- ✅ 丰富的格式 - 嵌入卡片、头像和高级占位符
与 EssentialsX Discord 对比:
- ✅ 更好的性能 - 异步处理和消息队列
- ✅ 更多功能 - HTTP 服务器、多个 webhooks、嵌入卡片
- ✅ 活跃开发 - 定期更新和新功能
- ✅ 现代代码库 - Java 21、最新 API、整洁的架构
? 许可证
AuryxDiscord 遵循 MIT 许可证。详见 LICENSE。
由 Auryx Studio 用 ❤️ 制作
需要 AuryxCore 才能发挥全部功能。属于完整的 Auryx 服务器管理套件的一部分!
? 快速开始
- 安装:下载 AuryxCore + AuryxDiscord
- 配置:在配置文件中添加 Discord webhook URL
- 测试:使用
/auryxdiscord test 命令
- 享受:无缝的 Minecraft-Discord 集成!
今天就开始转变你的服务器通信吧! ??
? AuryxDiscord - Lightweight Minecraft-Discord Integration
AuryxDiscord is a lightweight, high-performance Minecraft-Discord integration plugin built without JDA. Using modern HTTP clients (OkHttp + Jetty), it provides seamless two-way communication between your Minecraft server and Discord with minimal resource usage.
✨ Key Features
? Two-Way Communication
- Minecraft → Discord - Chat messages, events, notifications via webhooks
- Discord → Minecraft - Messages from Discord appear in-game via HTTP server
- Real-time sync - Instant message delivery with async processing
- No JDA dependency - Lightweight HTTP-only implementation
? Server Events Integration
- Join/Leave Messages - Player connection notifications with custom formats
- Death Messages - Death notifications with cause and custom formatting
- Chat Synchronization - Full chat integration with AuryxChat support
- Punishment Alerts - Ban/mute/kick notifications for moderation teams
- Server Status - Startup/shutdown notifications
? Rich Formatting & Customization
- Discord Embeds - Beautiful rich messages with colors and timestamps
- Player Avatars - Automatic player head integration via Minotar
- Custom Formats - Fully customizable message templates for each event type
- Placeholder Support - PlaceholderAPI and AuryxCore placeholder integration
- Emoji Support - ? Join, ? Leave, ☠️ Death, ⚠️ Punishments
? Advanced Configuration
- Multiple Webhooks - Separate channels for chat, logs, deaths, punishments
- Event Filtering - Enable/disable specific event types
- Message Queuing - Anti-spam protection with configurable queue limits
- HTTP Server - Built-in Jetty server for Discord → MC communication
? Commands Overview
| Command |
Description |
Permission |
/auryxdiscord |
Main plugin command |
auryxdiscord.admin |
/auryxdiscord reload |
Reload configuration |
auryxdiscord.reload |
/auryxdiscord test [message] |
Send test message to Discord |
auryxdiscord.test |
/auryxdiscord info |
View plugin status and integration info |
auryxdiscord.info |
? How It Works
Minecraft → Discord Flow
- Event Detection - Listeners capture chat, join/leave, death events
- Message Formatting - Apply custom templates with placeholders
- Webhook Delivery - Send via OkHttp to Discord webhook URLs
- Queue Management - Async processing prevents server lag
Discord → Minecraft Flow
- HTTP Server - Built-in Jetty server receives Discord webhooks
- Message Processing - Parse and validate incoming Discord messages
- Chat Integration - Forward to AuryxChat or broadcast directly
- Security - Webhook signature verification for safety
? Message Examples
Discord Notifications
? **Sqrilizz** joined the server (Players: 5/20)
[MC] Sqrilizz: Hello everyone from Minecraft!
☠️ Sqrilizz was slain by Zombie
⚠️ **Admin** banned **Griefer**: Griefing spawn area
✅ **Server started** - Players can now join!
Minecraft Chat
[Discord] DiscordUser: Hello from Discord!
[Discord] Moderator: Server restart in 5 minutes
⚙️ Configuration Highlights
Webhook Setup (config.yml)
webhooks:
chat: "https://discord.com/api/webhooks/YOUR_CHAT_WEBHOOK"
log: "https://discord.com/api/webhooks/YOUR_LOG_WEBHOOK"
death: "https://discord.com/api/webhooks/YOUR_DEATH_WEBHOOK"
punishment: "https://discord.com/api/webhooks/YOUR_MOD_WEBHOOK"
Event Configuration
events:
join-leave: true
deaths: true
punishments: true
console: false
startup-shutdown: true
Message Formats
formats:
join: "? **{player}** joined the server (Players: {online}/{max})"
leave: "? **{player}** left the server"
death: "☠️ {death_message}"
ban: "⚠️ **{staff}** banned **{player}**: {reason}"
HTTP Server (Discord → MC)
server:
enabled: true
port: 8080
path: "/discord-webhook"
secret: "your-webhook-secret"
? Platform Compatibility
| Platform |
Status |
Features |
| Paper |
✅ Full Support |
All features available |
| Folia |
✅ Full Support |
Thread-safe implementation |
| Spigot |
✅ Compatible |
Core features work |
| Bukkit |
✅ Compatible |
Basic functionality |
| Purpur |
✅ Enhanced |
Additional optimizations |
| Velocity |
✅ Supported |
Cross-server integration |
? Integration & Dependencies
Required Dependencies
Optional Integrations
- AuryxChat - Enhanced chat formatting and modes
- PlaceholderAPI - Extended placeholder support
- AuryxLink - Discord account linking (planned)
Developer API
// Get AuryxDiscord API
AuryxDiscordAPI api = AuryxDiscord.getAPI();
// Send messages to Discord
api.sendChatMessage(player, "Hello Discord!");
api.sendLogMessage("Server event occurred");
api.sendEmbed("Title", "Description", "#5865F2");
// Check integration status
boolean enabled = api.isDiscordEnabled();
boolean chatSync = api.isChatEnabled();
? Performance & Technical Details
Lightweight Architecture
- No JDA - Uses OkHttp for HTTP requests (much lighter)
- Async Processing - All Discord operations are non-blocking
- Smart Queuing - Message queue prevents spam and rate limiting
- Memory Efficient - Minimal RAM usage compared to bot-based solutions
HTTP Components
- OkHttp Client - Modern, efficient HTTP requests to Discord
- Jetty Server - Embedded HTTP server for receiving Discord messages
- Gson JSON - Fast JSON processing for webhook payloads
- Shaded Dependencies - No conflicts with other plugins
Cross-Version Support
- Single JAR - Works on Minecraft 1.8.8 through 1.21.10
- API Compatibility - Adapts to different Bukkit/Paper API versions
- Legacy Support - Maintains compatibility with older server versions
? Setup Guide
1. Installation
- Download AuryxCore (required)
- Download AuryxDiscord from Modrinth
- Place both JARs in your
plugins/ folder
- Restart your server
2. Discord Webhook Setup
- Go to your Discord server settings
- Navigate to Integrations → Webhooks
- Create webhooks for different channels:
#minecraft-chat - For player chat messages
#server-logs - For join/leave/death events
#moderation - For punishment notifications
- Copy webhook URLs to
config.yml
3. Configuration
# Basic setup - just add your webhook URLs
webhooks:
chat: "https://discord.com/api/webhooks/123456789/abcdefg"
log: "https://discord.com/api/webhooks/987654321/hijklmn"
# Enable desired events
events:
join-leave: true
deaths: true
punishments: true
# Optional: Enable Discord → Minecraft
server:
enabled: true # Allows Discord users to send messages to MC
port: 8080
secret: "change-this-secret"
4. Testing
/auryxdiscord info # Check integration status
/auryxdiscord test # Send test message to Discord
? Use Cases
? Roleplay Servers
- Immersive Discord integration for RP communities
- Character death notifications
- Staff moderation alerts
? Survival Servers
- Player activity monitoring
- Community chat bridge
- Achievement sharing
? Mini-game Networks
- Cross-server announcements via Velocity
- Tournament notifications
- Player statistics sharing
?️ Moderated Communities
- Real-time punishment notifications
- Staff communication bridge
- Server status monitoring
? Advanced Features
Message Placeholders
# Available placeholders in message formats:
{player} # Player name
{displayname} # Player display name
{message} # Chat message content
{server} # Server name
{online} # Current online players
{max} # Maximum players
{balance} # Player balance (AuryxCore)
{death_message} # Full death message
{staff} # Staff member name
{reason} # Punishment reason
# PlaceholderAPI support:
%player_name% # Player name
%server_online% # Online count
%auryxcore_balance% # Player balance
# + 1000+ other PAPI placeholders
Webhook Security
- Signature Verification - Validates incoming Discord webhooks
- Secret Keys - Configurable webhook secrets
- IP Filtering - Optional IP whitelist for HTTP server
- Rate Limiting - Built-in protection against spam
Multi-Channel Setup
webhooks:
chat: "https://discord.com/api/webhooks/chat-webhook"
log: "https://discord.com/api/webhooks/log-webhook"
death: "https://discord.com/api/webhooks/death-webhook"
punishment: "https://discord.com/api/webhooks/mod-webhook"
# Events automatically route to appropriate channels
# Falls back to 'log' webhook if specific webhook not configured
? Support & Community
? Why Choose AuryxDiscord?
vs Traditional Discord Bots:
- ✅ No Bot Hosting - Runs directly on your Minecraft server
- ✅ Lower Resource Usage - No JDA, just HTTP requests
- ✅ Easier Setup - No bot tokens or permissions needed
- ✅ Better Integration - Direct access to server events and data
vs Other Discord Plugins:
- ✅ Modern Architecture - Built for Paper/Folia with async processing
- ✅ Lightweight - 6MB vs 20MB+ for JDA-based plugins
- ✅ Two-Way Communication - Most plugins only do MC → Discord
- ✅ Rich Formatting - Embeds, avatars, and advanced placeholders
vs EssentialsX Discord:
- ✅ Better Performance - Async processing and message queuing
- ✅ More Features - HTTP server, multiple webhooks, embeds
- ✅ Active Development - Regular updates and new features
- ✅ Modern Codebase - Java 21, latest APIs, clean architecture
? License
AuryxDiscord is licensed under the MIT License. See LICENSE for details.
Made with ❤️ by Auryx Studio
Requires AuryxCore for full functionality. Part of the complete Auryx server management suite!
? Quick Start
- Install: Download AuryxCore + AuryxDiscord
- Configure: Add Discord webhook URLs to config
- Test: Use
/auryxdiscord test command
- Enjoy: Seamless Minecraft-Discord integration!
Transform your server communication today! ??
评论 0
登录后参与评分
还没有评论,来抢沙发吧