1. 创建桥接实例
-
前往
-
在 创建一个 Discord 机器人
-
在机器人设置中启用“消息内容意图 (Message Content Intent)”
-
获取你的机器人令牌并将其邀请到你的服务器
-
填写以下表单:
- 桥接名称(例如,“myserver”)
- Discord 机器人令牌
- 初始 Discord 频道 ID
-
重要: 保存端点 URL —— 你只有一次机会看到它!
-
将模组安装到你的 Fabric 1.21.4 服务器/客户端
-
在游戏中,仅使用步骤 2 中的桥接名称运行 /link <bridge-name>(例如,/link myserver)
-
在 Discord 中,使用 Minecraft 用户名运行 /link <user>
-
在游戏中,运行 /confirm 或 /deny 以确认或拒绝将 Discord 用户链接到你的 Minecraft 账号
-
使用 /dc <message> 向 Discord 发送消息
2. Discord 配置
你的 Discord 机器人将自动拥有以下斜杠命令:
/setchannel <channel> - 更改要桥接的频道
/bridgeinfo - 显示当前桥接配置和 ping 设置
/pingconfig [users] [roles] [everyone] [here] - 配置允许的 ping 来源
/link <minecraft_username> - 将 Discord 用户链接起来以便向 Discord 发送聊天
Minecraft
/pingsettings - 查看当前的 ping 配置
/blacklistuser <user> <add/remove> - 从 ping 黑名单中添加或删除用户
/blacklistrole <role> <add/remove> - 从 ping 黑名单中添加或删除角色
/blacklistview - 查看所有已列入黑名单的用户和角色
/link - 发送 Discord 链接
用法
- 来自配置频道的 Discord 消息会显示在 Minecraft 聊天栏中,格式为
[Discord] 用户名: 消息
- Minecraft 玩家可以使用
/dc <消息> 命令向 Discord 发送消息
- 来自 Minecraft 的消息会根据 ping 设置自动进行清理
Ping 控制
默认情况下,新创建的桥接允许用户 ping,但会阻止角色 ping、@everyone 和 @here。使用 Discord 斜杠命令来自定义:
- 用户提及(@username):单独的用户提及
- 角色提及(@role):角色的提及
- @everyone:提及所有服务器成员
- @here:提及所有在线成员
基础配置示例:
/pingconfig users:true roles:false everyone:false here:false - 仅允许用户 Ping(默认)
/pingconfig users:true roles:true everyone:true here:true - 允许所有 Ping
/pingconfig users:false roles:false everyone:false here:false - 屏蔽所有 Ping
黑名单系统
即使用户/角色 Ping 已启用,您也可以将特定用户或角色加入黑名单:
- 用户黑名单:无法从 Minecraft 被 Ping 的特定用户
- 角色黑名单:无法从 Minecraft 被 Ping 的特定角色
黑名单示例:
/blacklistuser @Admin add - 禁止提及 Admin 用户
/blacklistrole @Moderators add - 禁止提及 Moderators 角色
/blacklistuser @Admin remove - 允许再次提及 Admin
/blacklistview - 查看所有被拉黑的用户和角色
注意:即使其类型(用户/角色)通常是被允许的,被拉黑的用户/角色也会被阻止。
配置
模组配置文件 (config/mcdiscordbridge.json) 包含以下内容:
serverUrl: 您特定桥接实例的端点 URL
checkIntervalTicks: 检查新消息的频率(默认值:40 tick = 2 秒)
您可以在游戏内使用 /link <bridge-name> 命令更新桥接(例如 /link myserver)。
1. Create a Bridge Instance
-
Go to
-
Create a Discord bot at
-
Enable "Message Content Intent" in bot settings
-
Get your bot token and invite it to your server'
-
Fill out the form with:
- Bridge name (e.g., "myserver")
- Discord bot token
- Initial Discord channel ID
-
IMPORTANT: Save the endpoint URL - this is the only time you'll see it!
-
Install the mod in your Fabric 1.21.4 server/client
-
In-game, run /link <bridge-name> with just the bridge name from step 2 (e.g., /link myserver)
-
Discord, run /link <user> with the name of the minecraft user
-
In-game, run /confirm or /deny to confirm or deny the discord user linking to your minecraft account
-
Use /dc <message> to send messages to Discord
2. Discord Configuration
Your Discord bot will automatically have these slash commands:
/setchannel <channel> - Change which channel to bridge
/bridgeinfo - Show current bridge configuration and ping settings
/pingconfig [users] [roles] [everyone] [here] - Configure what pings are allowed from
/link <minecraft_username> - link to discord user to send chats to discord
Minecraft
/pingsettings - View current ping configuration
/blacklistuser <user> <add/remove> - Add or remove users from ping blacklist
/blacklistrole <role> <add/remove> - Add or remove roles from ping blacklist
/blacklistview - View all blacklisted users and roles
/link - Send link to discord
Usage
- Discord messages from the configured channel appear in Minecraft chat as
[Discord] Username: Message
- Minecraft players can send messages to Discord using
/dc <message>
- Messages from Minecraft are automatically sanitized based on ping settings
Ping Control
By default, new bridges allow user pings but block role pings, @everyone, and @here. Use Discord slash commands to customize:
- User Pings (@username): Individual user mentions
- Role Pings (@role): Role mentions
- @everyone: Pings all server members
- @here: Pings all online members
Basic Configuration Examples:
/pingconfig users:true roles:false everyone:false here:false - Only allow user pings (default)
/pingconfig users:true roles:true everyone:true here:true - Allow all pings
/pingconfig users:false roles:false everyone:false here:false - Block all pings
Blacklist System
Even when user/role pings are enabled, you can blacklist specific users or roles:
- User Blacklist: Specific users who can't be pinged from Minecraft
- Role Blacklist: Specific roles that can't be pinged from Minecraft
Blacklist Examples:
/blacklistuser @Admin add - Prevent pinging the Admin user
/blacklistrole @Moderators add - Prevent pinging the Moderators role
/blacklistuser @Admin remove - Allow pinging Admin again
/blacklistview - See all blacklisted users and roles
Note: Blacklisted users/roles are blocked even if their type (user/role) is generally allowed.
Configuration
The mod configuration file (config/mcdiscordbridge.json) includes:
serverUrl: The endpoint URL for your specific bridge instance
checkIntervalTicks: How often to check for new messages (default: 40 ticks = 2 seconds)
You can update the bridge in-game using /link <bridge-name> (e.g., /link myserver)
评论 0
登录后参与评分
还没有评论,来抢沙发吧