
DiscordNickSync 是一个适用于 Minecraft Java Edition 的插件,允许玩家通过 DiscordSRV 将 Discord 昵称与 Essentials 昵称同步,反之亦然。
我知道 DiscordSRV 已经 支持从 Minecraft 到 Discord 的同步,但它不支持反向同步。因此我开发了这款插件来实现这一功能!
昵称同步时机
DiscordNickSync 目前仅在玩家执行以下任一操作时同步昵称:
- 登录游戏
- 通过 DiscordSRV 将 Discord 账号与 Minecraft 关联
- 更改 Essentials 设置的昵称
- 使用命令
/discordnick sync
目前没有从 Discord 向 Minecraft 同步昵称的定时任务。如果您希望添加此功能,请创建一个 Issue,我会考虑将其加入。
提及
DiscordNickSync 还支持同步 Discord 中的提及功能!
- 在 Minecraft 聊天中输入
@<昵称>,即可同时 Ping 链接的 Discord 账户。
- 来自 Discord 的提及也会 Ping Minecraft 中的在线玩家。
- 可选配置被提及玩家的声音和标题消息。
请注意,按照我目前的设置方式,Minecraft 中的消息会改用 Discord 的昵称。目前我还不知道如何避免这种情况,并希望做出更改。如果您知道其他实现方式,请在 我们的 Discord 上告知我!
默认文件
Config.yml
# 请勿修改此项
internal:
plugin-version: "X.X.X"
# 请勿修改此项
# 用于 Minecraft 和 Discord 的默认名称。
# 只要玩家拥有 discordnick.use 权限,就可以自行更改此名称。
# 可设置为 "minecraft"、"discord" 或 "off"
default-sync: minecraft
# 在从 Discord 同步到 Minecraft 时,替换空白字符所使用的字符。
# 保持为 "" 以移除空白字符。
# 设置为 " " 以保持为空格。
# 设置为其他任意值则以该值进行替换。
replace-whitespaces-with: ""
# 是否在替换之前将连续的空白字符合并为一个。
merge-whitespaces-before-replacing: true
在 Minecraft 聊天栏中输入 @<Minecraft 用户名|Essentials 昵称|Discord 昵称>,即可同时 ping 关联的 Discord 账号。
当在 Discord 上被 ping 时,@提及 同样有效,但提及颜色除外。
mentions:
设为 false 以禁用提及功能。
enabled: true
玩家在收到提及时听到的声音。
如果您不希望出现多个声音,请手动在 DiscordSRV 的 config.yml 中禁用 MinecraftMentionSound。
play-sound:
enabled: true
# 可以是此网页上“Java Edition values”下列出的任何值:
sound: "block.note_block.bell"
# 0 到 1 之间的任意小数。
volume: 1.0
# 0 到 2 之间的任意小数。
pitch: 1.0
向被提及的玩家显示标题。
send-title:
enabled: true
# 输入 {mentioner} 以显示提及者的昵称
# 支持颜色格式
title: "&e您已被提及"
# 输入 {mentioner} 以显示提及者的昵称
# 支持颜色格式
subtitle: "&eby &6&l{mentioner}"
duration:
# 标题淡入所需的刻度数。
fade-in: 5
# 标题停留在屏幕上所需的刻度数。
stay: 70
# 标题淡出所需的刻度数。
fade-out: 5
聊天中提及的颜色。
设置为 "" 以禁用
color: "&e"
updater:
是否通知管理员新的快照版本。管理员仍会在稳定版本发布时收到通知。
notify-on-dev-release: false
## Language.yml
```yml
colors:
default: "&e"
highlight: "&6"
error: "&c"
error_highlight: "&6"
messages:
# {d} 代表默认颜色
# {h} 代表高亮颜色
# {e} 代表错误颜色
# {eh} 代表错误高亮颜色
reload_success: "{h}DiscordNickSync {d}配置已重新加载。"
# 其他占位符:{player} {from} {to}
sync_success: "{d}已同步 {h}{player} {d}({from} → {to})"
# 其他占位符:{count}
sync_all_success: "{d}已同步 {h}{count} {d}名玩家。"
# 其他占位符:{player}
sync_disabled: "{h}{player}{d} 已禁用同步功能。"
# 其他占位符:{nickname} {from} {to}
nickname_updated: "{d}您的 {to} 昵称已更新为 {h}{nickname}{d}。"
# 其他占位符:{from} {to}
mode_set: "{d}您的 {to} 昵称现在将使用您的 {h}{from} {d}昵称"
sync_notif: "{d}如果您想配置昵称同步方式,请输入 {h}/discordnick"
mode_off: "{d}您的昵称将不再在 Minecraft 和 Discord 之间同步。"
errors:
# {d} 代表默认颜色
# {h} 代表高亮颜色
# {e} 代表错误颜色
# {eh} 代表错误高亮颜色
no_permission: "{e}您没有权限使用此命令。"
# 其他占位符:{player}
player_not_found: "{eh}{player} {e}未找到或离线"
# 其他占位符:{player}
sync_not_linked: "{eh}{player} {e}尚未链接其 Discord 账户。"
# 用法将在之后显示。
invalid_command: "{e}无效的用法!"
only_players: "{e}只有玩家才能使用此命令。"
命令
/discordnick < discord | minecraft | off >
/discordnick sync [ all | <username> ]
/discordnick reload
权限
discordnick.use
- 允许玩家:
- 设置自己的昵称同步模式
- 为自己运行
/discordnick sync。
- 默认值:
true
discordnick.admin
- 允许管理员:
- 为所有玩家或单个玩家运行
/discordnick sync。
- 通过
/discordnick reload 重新加载配置。
- 默认值:
op
支持
如果您有任何问题,或希望请求新功能,请创建 Issue,我将尽力提供帮助!

DiscordNickSync is a plugin for Minecraft Java Edition that lets your players sync their Discord nickname to their Essentials nickname, and vice versa, via DiscordSRV.
I know that DiscordSRV already allows syncing from Minecraft to Discord, but it doesn't allow syncing the other way around. So I created this plugin to do that!
When Nicknames are Synced
DiscordNickSync currently only syncs nicknames when a player does any of the following:
- Logs in
- Links their Discord to Minecraft via DiscordSRV
- Changes their Essentials nickname.
- Uses the command
/discordnick sync
There is currently no timer to sync nicknames from Discord to Minecraft. If this is a feature you would want, create an issue, and I will consider adding it.
Mentions
DiscordNickSync also allows syncing of Discord mentions!
- Type
@<nickname> in minecraft chat to also ping the linked account on Discord.
- Mentions from Discord also ping online players in Minecraft.
- Optionally configure a sound and a title message for the mentioned player.
Note that the way I've set it up, it changes the message in Minecraft to use Discord's nickname. I do not currently know a way around this and would like to change this. If you know another way to implement it, please let me know on Our Discord!
Default Files
Config.yml
# DO NOT CHANGE THIS
internal:
plugin-version: "X.X.X"
# DO NOT CHANGE THIS
# What name to use by default for both Minecraft and Discord.
# This can be changed by the player as long as they have the permission discordnick.use
# Can either be "minecraft", "discord", or "off"
default-sync: minecraft
# What to replace whitespace characters with when syncing from Discord to Minecraft.
# Keep this as "" to remove whitespace characters.
# Set this to " " to keep as spaces.
# Set this to anything else to replace it with that.
replace-whitespaces-with: ""
# Whether to combine whitespace characters together before replacing them with the value above.
merge-whitespaces-before-replacing: true
# Type @<minecraft username|essentials nickname|discord nickname> in minecraft chat to also ping the linked account on Discord.
# Mentions also work when pinged on Discord, except for the mention color.
mentions:
# Set to false to disable mentions.
enabled: true
# The sound that a player hears when they are mentioned.
# You must manually disable MinecraftMentionSound in DiscordSRV's config.yml if you don't want multiple sounds.
play-sound:
enabled: true
# Can be any value listed under "Java Edition values" on this webpage: https://minecraft.wiki/w/Sounds.json#Sound_events
sound: "block.note_block.bell"
# Any decimal number between 0 and 1.
volume: 1.0
# Any decimal number between 0 and 2.
pitch: 1.0
# Display a title to the player who is mentioned.
send-title:
enabled: true
# Type {mentioner} for the nickname of the person who mentioned you
# Color formats are supported
title: "&eYou have been mentioned"
# Type {mentioner} for the nickname of the person who mentioned you
# Color formats are supported
subtitle: "&eby &6&l{mentioner}"
duration:
# The duration in ticks for the title to fade in.
fade-in: 5
# The duration in ticks for the title to stay on the screen.
stay: 70
# The duration in ticks for the title to fade out.
fade-out: 5
# The color of the mention in chat.
# Set to "" to disable
color: "&e"
updater:
# Whether to notify admins for new snapshot releases. Admins will still be notified on stable releases.
notify-on-dev-release: false
Language.yml
colors:
default: "&e"
highlight: "&6"
error: "&c"
error_highlight: "&6"
messages:
# {d} for default color
# {h} for highlight color
# {e} for error color
# {eh} for error highlight
reload_success: "{h}DiscordNickSync {d}configuration reloaded."
# Additional placeholders: {player} {from} {to}
sync_success: "{d}Synced {h}{player} {d}({from} → {to})"
# Additional placeholders: {count}
sync_all_success: "{d}Synced {h}{count} {d}players."
# Additional placeholders: {player}
sync_disabled: "{h}{player}{d} has syncing disabled."
# Additional placeholders: {nickname} {from} {to}
nickname_updated: "{d}Your {to} nickname has been updated to {h}{nickname}{d}."
# Additional placeholders: {from} {to}
mode_set: "{d}Your {to} nickname will now use your {h}{from} {d}nickname"
sync_notif: "{d}If you would like to configure how your nick is synced, type {h}/discordnick"
mode_off: "{d}Your nicknames will no longer be synced between Minecraft and Discord."
errors:
# {d} for default color
# {h} for highlight color
# {e} for error color
# {eh} for error highlight
no_permission: "{e}You do not have permission to use this command."
# Additional placeholders: {player}
player_not_found: "{eh}{player} {e}not found or offline"
# Additional placeholders: {player}
sync_not_linked: "{eh}{player} {e}has not linked their Discord account."
# The usage will be shown after this.
invalid_command: "{e}Invalid command usage!"
only_players: "{e}Only players can use this command."
Commands
/discordnick < discord | minecraft | off >
/discordnick sync [ all | <username> ]
/discordnick reload
Permissions
discordnick.use
- Allows players to:
- Set their own nickname sync mode
- Run
/discordnick sync for themselves.
- Default:
true
discordnick.admin
- Allows admins to:
- Run
/discordnick sync for all players or individual players.
- Reload the config with
/discordnick reload
- Default:
op
Support
If you have any issues, or want to request a feature, please create an issue, and I will try my best to help!
评论 0
登录后参与评分
还没有评论,来抢沙发吧