?️ MCLocalAuth
集成 Discord 机器人的 Minecraft 身份验证插件
? 描述
MCLocalAuth 是一款 Minecraft 服务器安全插件,使用 Discord 作为身份验证系统。通过限制仅允许你的 Discord 社区成员访问,来保护你的服务器。
支持 Spigot/Paper、BungeeCord 和 Velocity —— Discord 机器人在这三个平台上均可运行并具备所有功能。
? 工作原理
- 玩家连接 → 立即断开连接并获得一个唯一代码
- 在 Discord 上 → 输入
/mclogin <code>(在服务器上或在机器人的私聊中) - 机器人验证 → 该玩家是否为 Discord 成员?
- 如果是 → 注册 IP,允许重新连接 ✅
- 如果否 → 阻止 ❌
? 使用统计
Spigot / Paper :
BungeeCord :
Velocity :
✨ 特性
? 三重安全层
- ✅ 需要 Discord:只有你的 Discord 成员才能游玩
- ✅ 临时代码:每次连接都会生成一个过期的唯一代码
- ✅ IP 保护:一个用户名 = 一个 IP → 无法窃取身份
? 集成 Discord 机器人
- 随服务器自动启动
- 无需托管外部机器人
- 无需打开网络端口
- 原生 Discord 斜杠命令
- 支持 Spigot/Paper、BungeeCord 和 Velocity
- 支持在私聊中使用命令(全局注册)
- 启动时自动验证机器人状态
?️ 灵活的存储
- YAML(默认):本地
data.yml文件 - MySQL(可选):跨服务器的共享数据库
- 非常适合多服务器网络(BungeeCord/Velocity)
? 自动更新检查器
- 启动时检查 Modrinth API
- 如果有新版本可用,会在控制台通知
? Geyser/Bedrock 支持
- 自动检测 Bedrock 玩家
- 适配的踢出消息(无颜色代码)
? Discord 命令
| 命令 | 描述 | 权限 |
|---|---|---|
/mclogin <code> |
使用在游戏中获得的代码进行身份验证 | 所有人 |
/mctest |
测试机器人 ↔ 插件连接 | 所有人 |
/status |
检查你的身份验证状态 | 所有人 |
/unlink <discord_id> |
解除账户关联 | 管理员 |
/mcadmin showips <player> |
查看已授权的 IP | 管理员 |
/mcadmin addip <player> <ip> |
添加已授权的 IP | 管理员 |
/mcadmin removeip <player> <ip> |
移除已授权的 IP | 管理员 |
/mcadmin resetip <player> |
重置所有 IP | 管理员 |
/mcadmin setip <player> <ip> |
设置主 IP | 管理员 |
管理员命令仅限于在
config.yml的admin.discord_id中设置的 Discord ID。
⚙️ 游戏内管理员命令
| 命令 | Spigot/Paper | BungeeCord | Velocity |
|---|---|---|---|
/auth showips <player> |
✅ | ✅ | ✅ |
/auth addip <player> <ip> |
✅ | ✅ | ✅ |
/auth removeip <player> <ip> |
✅ | ✅ | ✅ |
/auth resetip <player> |
✅ | ✅ | ✅ |
/auth setip <player> <ip> |
✅ | ✅ | ✅ |
? 安装
前置条件
- Minecraft 服务器 1.8.9 到 26.2 (Spigot, Paper, Purpur)、BungeeCord 或 Velocity 3.3.0+
- Java 8 及以上版本 (Spigot/BungeeCord) · Java 17 及以上版本 (Velocity)
- 已在 Discord Developer Portal 配置好的 Discord 机器人
Spigot / Paper / BungeeCord
- 下载
MCLocalAuth-v1.4.1.jar - 放置 文件到你的服务器
plugins/文件夹中 - 启动 服务器以生成配置文件
- 配置
plugins/MCLocalAuth/config.yml中的 Discord 机器人:
discord:
enabled: true
bot_token: "YOUR_DISCORD_BOT_TOKEN"
guild_id: "YOUR_DISCORD_SERVER_ID"
invite_link: ""
admin:
discord_id: "YOUR_DISCORD_ID"
storage:
type: "yaml" # yaml 或 mysql
mysql:
host: "localhost"
port: 3306
database: "mclocalauth"
username: "root"
password: ""
- 重启 服务器
- 测试 在 Discord 上使用
/mctest
Velocity
- 下载
MCLocalAuth-Velocity-v1.4.1.jar - 放置 在你的代理服务器
plugins/文件夹中 - 配置
plugins/mclocalauth/config.yml - 重启 代理服务器
? 配置
Discord 机器人设置
- 前往 Discord Developer Portal
- 创建一个新的应用
- Bot 选项卡 → 创建机器人
- 复制令牌(切勿分享!)
- 启用以下 特权网关意图 (Privileged Gateway Intents):
- ✅ 服务器成员意图 (Server Members Intent)
- ✅ 消息内容意图 (Message Content Intent)(可选)
- OAuth2 → URL Generator 选项卡:
- 勾选
bot和applications.commands - 权限:
Administrator(或自定义)
- 勾选
- 使用生成的 URL 邀请 机器人到你的服务器
获取 Discord 服务器 ID
- 在 Discord 中启用 开发者模式:
- 设置 → 高级 → 开发者模式
- 右键点击你的服务器 → 复制服务器 ID
- 粘贴到
config.yml中的guild_id
Java: 8+ (Spigot/BungeeCord) · 17+ (Velocity)
注意: 插件会在启动时自动检测你的 Minecraft 版本。
? 报告 Bug
如果你遇到问题:
- 请确认你使用的是最新版本
- 查看 现有 Issue
- 如果问题仍然存在,请 提交新的 Issue,并附上:
- 插件版本
- Minecraft 版本
- 服务器日志
- 详细的问题描述
? 建议功能
有新想法?请使用 enhancement 标签 提交 Issue!
? 许可证
本项目采用 专有许可证。详情请参阅 LICENSE 文件。
简要说明:
- ✅ 可在 Minecraft 服务器上免费使用
- ✅ 可查看代码以学习
- ❌ 禁止修改或重新分发
- ❌ 禁止商业使用
? 致谢
开发者: UNGEUR
使用的库:
- JDA - Java Discord API
- Spigot API - Minecraft Server API
- BungeeCord API - 代理 API
- Velocity API - 代理 API
- bStats - 插件指标统计
? 支持
- Discord: Discord 服务器
- Issue: GitHub Issues
⭐ 如果本插件对你有用,请不要犹豫给它一个 Star!
为 Minecraft 社区 ❤️ 制作
?️ MCLocalAuth
Minecraft Authentication Plugin with Integrated Discord Bot
? Description
MCLocalAuth is a security plugin for Minecraft servers that uses Discord as an authentication system. Protect your server by limiting access to only members of your Discord community.
Works on Spigot/Paper, BungeeCord and Velocity — the Discord bot runs on all 3 platforms with all features.
? How It Works
- Player Connects → Immediately disconnected with a unique code
- On Discord → Type
/mclogin <code>(on server or in DMs with the bot) - Bot Verifies → Is the player a Discord member?
- If Yes → IP registered, reconnection authorized ✅
- If No → Blocked ❌
? Usage Statistics
Spigot / Paper :
BungeeCord :
Velocity :
✨ Features
? Triple Layer Security
- ✅ Discord Required: Only members of your Discord can play
- ✅ Temporary Code: Each connection generates a unique code that expires
- ✅ IP Protection: One username = One IP → Impossible to steal identities
? Integrated Discord Bot
- Starts automatically with the server
- No external bot to host
- No network ports to open
- Native Discord slash commands
- Works on Spigot/Paper, BungeeCord and Velocity
- Commands available in DMs (globally registered)
- Automatic bot status verification at startup
?️ Flexible Storage
- YAML (default): local
data.ymlfile - MySQL (optional): shared database across servers
- Ideal for multi-server networks (BungeeCord/Velocity)
? Auto Update Checker
- Checks Modrinth API at startup
- Console notification if a newer version is available
? Geyser/Bedrock Support
- Automatic Bedrock player detection
- Adapted kick messages (no color codes)
? Discord Commands
| Command | Description | Access |
|---|---|---|
/mclogin <code> |
Authenticate with the code received in-game | Everyone |
/mctest |
Test bot ↔ plugin connection | Everyone |
/status |
Check your authentication status | Everyone |
/unlink <discord_id> |
Unlink an account | Admin |
/mcadmin showips <player> |
View authorized IPs | Admin |
/mcadmin addip <player> <ip> |
Add an authorized IP | Admin |
/mcadmin removeip <player> <ip> |
Remove an authorized IP | Admin |
/mcadmin resetip <player> |
Reset all IPs | Admin |
/mcadmin setip <player> <ip> |
Set primary IP | Admin |
Admin commands are restricted to the Discord ID set in
admin.discord_idinconfig.yml.
⚙️ Admin Commands (in-game)
| Command | Spigot/Paper | BungeeCord | Velocity |
|---|---|---|---|
/auth showips <player> |
✅ | ✅ | ✅ |
/auth addip <player> <ip> |
✅ | ✅ | ✅ |
/auth removeip <player> <ip> |
✅ | ✅ | ✅ |
/auth resetip <player> |
✅ | ✅ | ✅ |
/auth setip <player> <ip> |
✅ | ✅ | ✅ |
? Installation
Prerequisites
- Minecraft Server 1.8.9 to 26.2 (Spigot, Paper, Purpur), BungeeCord or Velocity 3.3.0+
- Java 8 minimum (Spigot/BungeeCord) · Java 17 minimum (Velocity)
- Discord Bot configured on Discord Developer Portal
Spigot / Paper / BungeeCord
- Download
MCLocalAuth-v1.4.1.jar - Place the file in your server's
plugins/folder - Start the server to generate configuration
- Configure the Discord bot in
plugins/MCLocalAuth/config.yml:
discord:
enabled: true
bot_token: "YOUR_DISCORD_BOT_TOKEN"
guild_id: "YOUR_DISCORD_SERVER_ID"
invite_link: ""
admin:
discord_id: "YOUR_DISCORD_ID"
storage:
type: "yaml" # yaml or mysql
mysql:
host: "localhost"
port: 3306
database: "mclocalauth"
username: "root"
password: ""
- Restart the server
- Test with
/mcteston Discord
Velocity
- Download
MCLocalAuth-Velocity-v1.4.1.jar - Place in your proxy's
plugins/folder - Configure
plugins/mclocalauth/config.yml - Restart the proxy
? Configuration
Discord Bot Setup
- Go to Discord Developer Portal
- Create a new application
- Bot tab → Create a bot
- Copy the token (never share it!)
- Enable these Privileged Gateway Intents:
- ✅ Server Members Intent
- ✅ Message Content Intent (optional)
- OAuth2 → URL Generator tab:
- Check
botandapplications.commands - Permissions:
Administrator(or custom)
- Check
- Invite the bot to your server with the generated URL
Get Discord Server ID
- Enable Developer Mode in Discord:
- Settings → Advanced → Developer Mode
- Right-click on your server → Copy Server ID
- Paste in
guild_idinconfig.yml
? Compatibility
| Platform | Versions | JAR |
|---|---|---|
| Paper | 1.8.9 → 26.2 ✅ | MCLocalAuth-v1.4.1.jar |
| Spigot | 1.8.9 → 1.21.x ✅ | MCLocalAuth-v1.4.1.jar |
| Purpur | 1.8.9 → 1.21.x ✅ | MCLocalAuth-v1.4.1.jar |
| BungeeCord | Build 2068 ✅ | MCLocalAuth-v1.4.1.jar |
| Velocity | 3.3.0+ ✅ | MCLocalAuth-Velocity-v1.4.1.jar |
Java: 8+ (Spigot/BungeeCord) · 17+ (Velocity)
Note: The plugin automatically detects your Minecraft version at startup.
? Report a Bug
If you encounter a problem:
- Verify you're using the latest version
- Check existing Issues
- If the problem persists, open a new issue with:
- Plugin version
- Minecraft version
- Server logs
- Detailed problem description
? Suggest a Feature
Have an idea? Open an issue with the enhancement tag!
? License
This project is under proprietary license. See the LICENSE file for more details.
TL;DR:
- ✅ Free use on Minecraft servers
- ✅ View code to learn
- ❌ No modification/redistribution
- ❌ No commercial use
? Credits
Developer: UNGEUR
Libraries used:
- JDA - Java Discord API
- Spigot API - Minecraft Server API
- BungeeCord API - Proxy API
- Velocity API - Proxy API
- bStats - Plugin Metrics
? Support
- Discord: Discord Server
- Issues: GitHub Issues
⭐ If this plugin is useful to you, don't hesitate to star it!
Made with ❤️ for the Minecraft community
下载 MCLocalAuth
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 MCLocalAuth
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 MCLocalAuth
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 MCLocalAuth
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 MCLocalAuth
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 MCLocalAuth
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 MCLocalAuth
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 MCLocalAuth
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 MCLocalAuth
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
MCLocalAuth v1.4.1.1 — Velocity
类型: 更新 - 多语言系统
日期: 2026年7月4日
状态: BÉTA ⚠️
文件: MCLocalAuth-Velocity-v1.4.1.1.jar
✨ 新功能
? 多语言系统
所有面向玩家的消息现已外置到可编辑的语言文件中。
包含的语言:
- ?? 法语 (
fr_FR) - ?? 英语 (
en_US) — 默认 - ?? 西班牙语 (
es_ES) - ?? 波兰语 (
pl_PL)
配置:
language: "en_US" # 更改为 fr_FR、es_ES 或 pl_PL
已翻译的玩家消息(可编辑):
- 踢出消息(首次加入、未授权 IP)
- Bedrock 客户端踢出消息(无颜色代码)
/auth命令(帮助、错误、结果)- Discord 嵌入消息(认证、状态、管理员)
- Discord 斜杠命令描述
- 机器人活动文本
已翻译的控制台消息(不可编辑):
- 启动消息(存储、Discord)
- 错误消息(令牌、权限、连接)
- 管理员日志消息(添加/删除/重置 IP)
- 可用更新通知
语言文件:
在首次启动时生成于 plugins/mclocalauth/messages/:
en_US.yml,fr_FR.yml,es_ES.yml,pl_PL.yml
您可以编辑这些文件来自定义玩家消息。
ℹ️ 控制台消息遵循所选语言,但不可编辑(内置于插件中)。
? 自动迁移
config.yml顶部会自动添加language:键
? 兼容性
| 平台 | 版本 |
|---|---|
| Velocity | 3.3.0+ ✅ |
Java: 17+
? 安装 / 更新
- 下载
MCLocalAuth-Velocity-v1.4.1.1.jar - 将旧 JAR 替换为新的 JAR 放入
plugins/目录 - 重启代理服务器
config.yml中会自动添加language:键- 根据需要更改语言(
fr_FR、es_ES、pl_PL) - 语言文件位于
plugins/mclocalauth/messages/
? 已知问题
目前未发现任何 Bug。
构建: Maven 3.9.5 + Java 17
状态: BÉTA ⚠️
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
PacketEvents 是一款专为 Minecraft Java 版打造的协议库,旨在简化数据包的处理与传输。
插件
ExyliaPlugins 的库。
插件
通过对话框或铁砧界面帮助你的 Anthme
插件
自定义你的Minecraft头像!
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
为基于 Spigot/Paper/Folia 的服务器添加对 Vivecraft 的支持
评论 0
登录后参与评分
还没有评论,来抢沙发吧