?️ 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
使用的库:
? 支持
⭐ 如果本插件对你有用,请不要犹豫给它一个 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.yml file
- 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_id in config.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
/mctest on 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
bot and applications.commands
- Permissions:
Administrator (or custom)
- 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_id in config.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:
? Support
⭐ If this plugin is useful to you, don't hesitate to star it!
Made with ❤️ for the Minecraft community
评论 0
登录后参与评分
还没有评论,来抢沙发吧