ChatCard
一款聊天插件,允许你自定义聊天中显示的所有内容,并在鼠标悬停于玩家名称时显示统计卡片。
在聊天中悬停任何玩家的名称即可查看其金钱、碎片、击杀数、游戏时间和死亡次数。点击可执行命令。
卡片、每个权限组的聊天格式以及加入、离开和死亡消息均来源于配置文件。
功能
- 按权限组划分的聊天格式,通过权限节点选择
- 在聊天、加入和离开消息中,鼠标悬停于玩家名称时显示卡片,支持 PlaceholderAPI 占位符
- 点击玩家名称执行配置文件中定义的命令
- 自定义加入、首次加入、离开和死亡消息(死亡消息保留每种语言的原版文本)
- 提及功能:玩家自己的名称或
@name 会被高亮显示,并伴有音效和操作栏提示
- 按权限组设置聊天颜色:颜色代码、十六进制颜色、渐变色和格式控制
- 拥有权限的玩家可发送可点击链接;其他人则被屏蔽链接、域名和 IP
- 聊天过滤器:冷却时间、重复消息检测、大写过多限制和敏感词过滤
- Emoji 快捷输入,如
:heart: 和 :skull:
- 管理员工具:静音聊天、清除聊天、慢速模式和每条消息旁的删除按钮
/togglechat 和 /togglementions 命令供玩家使用,设置跨重启保存
- 禁用原版
/me 和 /teammsg 命令,防止有人绕过静音或过滤器发言
- 所有文本均支持
& 颜色代码、&#RRGGBB 十六进制颜色和 MiniMessage 标签(<gradient>、<rainbow>、<bold> ...)
- 支持 Folia
/chat reload 可在不重启服务器的情况下重新加载配置
依赖
- Paper 1.21.7 或更高版本,或 Folia(已在 Paper 1.21.7、Paper 26.1.2 和 Canvas 26.3 [Folia 分支] 上测试)
- 26.x 服务器需 Java 25 或更高版本,1.21.x 服务器需 Java 21 或更高版本
- PlaceholderAPI 用于占位符(可选)
默认配置使用以下 PlaceholderAPI 扩展:
/papi ecloud download Player
/papi ecloud download Vault
/papi ecloud download Statistic
/papi ecloud download LuckPerms
默认悬停卡片中的 %shards% 是为你使用的碎片插件预留的。请将其替换为该插件对应的占位符。
安装
- 将
ChatCard-<version>.jar 放入你的 plugins 文件夹。
- 启动服务器。插件会在首次启动时下载 Kotlin。
- 编辑
plugins/ChatCard/config.yml 和 plugins/ChatCard/messages.yml,然后运行 /chat reload。
命令
| 命令 |
权限 |
描述 |
/chat mute |
chatcard.mute |
静音或取消静音聊天 |
/chat clear |
chatcard.clear |
清除聊天 |
/chat slow <seconds> |
chatcard.slow |
玩家每 X 秒可发送一条消息。设为 0 关闭此功能 |
/chat reload |
chatcard.reload |
重新加载 config.yml 和 messages.yml |
/togglechat |
chatcard.togglechat (所有人) |
隐藏其他玩家的聊天消息给你自己 |
/togglementions |
chatcard.togglementions (所有人) |
开启或关闭你自己的提及提醒 |
/chat 是 /chatcard 的简写。静音和慢速模式在服务器重启后会重置。
原版命令 /me 和 /teammsg (/tm) 发送的聊天会绕过静音、慢速模式和过滤器,因此 ChatCard
会为这些命令禁用玩家的使用权限,并从补全列表中隐藏它们。
权限
| 权限 |
默认值 |
描述 |
chatcard.staff |
op |
所有管理员命令及下方的 bypass 权限 |
chatcard.delete |
op |
在聊天消息前看到删除按钮 |
chatcard.bypass.mute |
op |
在聊天静音期间仍可发言 |
chatcard.bypass.cooldown |
op |
无冷却时间和慢速模式限制 |
chatcard.bypass.filter |
op |
跳过重复消息、大写和敏感词过滤器 |
chatcard.bypass.clear |
op |
在聊天被清除时保留自己的消息 |
chatcard.links |
op |
发送可点击链接 |
chatcard.chat.color |
op |
使用 &a 颜色代码和 <red> 颜色标签 |
chatcard.chat.hex |
op |
使用 &#RRGGBB 和 <#RRGGBB> 十六进制颜色 |
chatcard.chat.gradient |
op |
使用 <gradient:#FF0000:#0000FF> 和 <rainbow> |
chatcard.chat.format |
op |
使用 &l &o &n &m &k 和 <bold>, <italic> ... 等格式 |
chatcard.emojis |
everyone |
Emoji 快捷输入 |
chatcard.format.<name> |
nobody |
你在 config.yml 中为某个聊天格式设置的权限节点 |
聊天格式权限不会自动授予 OP。请使用你的权限插件进行分配。
配置
chat:
formats:
vip:
permission: chatcard.format.vip
format: "%vault_prefix%{player}&7: &#FFE400{message}"
default:
permission: ""
format: "%vault_prefix%{player}&7: &f{message}"
delete-button: "&c✖ "
delete-hover: "&cDelete this message"
hover:
lines:
- "%luckperms_prefix%%player_name%"
- "&7------------"
- "�FF11$ &fMoney: �FF11%vault_eco_balance_formatted%"
- "&#A52CF5⭐ &fShards: &#A52CF5%shards%"
- "&#FF0000🗡 &fKills: &#FF0000%statistic_player_kills%"
- "&#FFE400⌚ &fPlaytime: &#FFE400%statistic_time_played%"
- "&#FA7600☠ &fDeaths: &#FA7600%statistic_deaths%"
- "&7------------"
click: "/msg %player_name%"
join:
message: "&8[&a+&8] &7{player}"
first-join: "<gradient:#FFE400:#FA7600>Welcome</gradient> &f{player} &7to the server!"
quit:
message: "&8[&c-&8] &7{player}"
death:
message: "&#FA7600☠ &7{message}"
mentions:
highlight: "&#FFE400@{name}"
sound: "entity.experience_orb.pickup"
volume: 1.0
pitch: 1.0
actionbar: "&#FFE400{player} &7mentioned you"
filter:
cooldown: 1.0
duplicate-seconds: 30
caps:
min-letters: 6
max-percent: 60
words:
- fuck
- shit
- ...
emojis:
":heart:": "❤"
":star:": "★"
":skull:": "☠"
...
clear-lines: 100
| 键 |
说明 |
chat.formats |
从上到下依次检查。玩家获得其拥有 permission 的第一个格式。空的 permission 匹配所有人,因此请将 default 放在最后 |
{player} |
带有悬停卡片和点击命令的玩家名称。适用于聊天格式、加入、离开和死亡消息 |
{message} |
聊天消息,或 death.message 中的原版死亡消息 |
chat.delete-button |
在每位拥有 chatcard.delete 权限的玩家发送的每条聊天消息前显示 |
hover.lines |
悬停卡片。其中的占位符会替换为对应玩家的姓名 |
hover.click |
点击时执行的命令。其中的占位符会替换为被点击玩家的姓名 |
join.first-join |
玩家首次加入时显示,替代 join.message |
mentions.highlight |
提及对该被提及玩家的外观表现。{name} 为其姓名 |
mentions.sound |
任意 Minecraft 音效,写作 entity.experience_orb.pickup 或 ENTITY_EXPERIENCE_ORB_PICKUP |
mentions.actionbar |
{player} 是发送该消息的玩家 |
filter.cooldown |
同一玩家两条消息之间的间隔秒数 |
filter.duplicate-seconds |
在此秒数内再次发送相同消息将被拦截 |
filter.caps |
包含至少 min-letters 个字母且大写比例超过 max-percent 的消息会被转为小写 |
filter.words |
替换为 *。匹配完整单词,不区分大小写,并支持重复字母(如 shiiit) |
emojis |
快捷输入及其对应的文本内容 |
clear-lines |
/chat clear 命令清除的空行数 |
将某项设置为 "" 即可关闭它。这适用于加入、离开、首次加入、死亡消息、删除按钮、点击命令、提及高亮、音效和操作栏,以及 messages.yml 中的每一行。hover.lines: [] 可关闭悬停卡片。
玩家自己发送的消息不会经过 PlaceholderAPI,仅应用上述权限相关的颜色。像 <click> 或 <hover> 这样的标签始终保留为纯文本。
悬停卡片尺寸
Minecraft 对悬停卡片的字符数没有限制。限制因素是玩家的屏幕:
- 当行宽达到屏幕宽度的一半时会自动换行。在 1080p 分辨率且 GUI 缩放最大的情况下,约为 40 个字符。
- 高度超过屏幕的卡片会被截断。在 1080p 分辨率且 GUI 缩放最大的情况下,约为 25 行。
保持卡片在大约 20 行以内,即可适配所有屏幕。
消息删除
删除按钮使用 Minecraft 自带的消息删除功能,该功能仅在启用签名聊天时有效(即 online-mode=true 且 enforce-secure-profile=true,此为默认设置)。在未启用签名聊天的服务器,或使用移除了聊天签名的插件时,不会显示删除按钮。
构建
需要 JDK 25 或更高版本以及 Maven。
mvn package
生成的 jar 文件位于 target/ 目录中。
支持
在我的 Discord 上提问:
许可证
MIT
ChatCard
A chat plugin where you set everything that shows in chat, with a stats card when you hover a player's name.
Hover any player's name in chat to see their money, shards, kills, playtime and deaths. Click it to run a command. The
card, the chat format for every rank and the join, quit and death messages all come from the config.
Features
- Chat format per rank, picked by permission
- Hover card on player names in chat, join and quit messages, with PlaceholderAPI placeholders
- Clicking a player's name runs a command from the config
- Custom join, first-join, quit and death messages (death messages keep the vanilla text in each player's language)
- Mentions: a player's name or
@name is highlighted for them, with a sound and an actionbar
- Chat colors by permission: color codes, hex colors, gradients and formatting
- Clickable links for players with permission; links, domains and IPs are blocked for everyone else
- Chat filter: cooldown, repeated messages, too many capital letters and a word filter
- Emoji shortcuts like
:heart: and :skull:
- Staff tools: mute chat, clear chat, slow mode and a delete button on every message
/togglechat and /togglementions for players, saved across restarts
- Turns off the vanilla
/me and /teammsg commands, so nobody can talk around the mute or the filter
& colors, &#RRGGBB hex colors and MiniMessage tags (<gradient>, <rainbow>, <bold> ...) in every text
- Folia support
/chat reload to reload the config without a restart
Requirements
- Paper 1.21.7 or newer, or Folia (tested on Paper 1.21.7, Paper 26.1.2 and Canvas 26.3, a Folia fork)
- Java 25 or newer on 26.x servers, Java 21 or newer on 1.21.x servers
- PlaceholderAPI for placeholders (optional)
The default config uses these PlaceholderAPI expansions:
/papi ecloud download Player
/papi ecloud download Vault
/papi ecloud download Statistic
/papi ecloud download LuckPerms
%shards% in the default hover card is left for your shards plugin. Replace it with that plugin's placeholder.
Installation
- Put
ChatCard-<version>.jar in your plugins folder.
- Start the server. The plugin downloads Kotlin on first start.
- Edit
plugins/ChatCard/config.yml and plugins/ChatCard/messages.yml, then run /chat reload.
Commands
| Command |
Permission |
Description |
/chat mute |
chatcard.mute |
Mutes or unmutes the chat |
/chat clear |
chatcard.clear |
Clears the chat |
/chat slow <seconds> |
chatcard.slow |
Players can send one message every X seconds. 0 turns it off |
/chat reload |
chatcard.reload |
Reloads config.yml and messages.yml |
/togglechat |
chatcard.togglechat (everyone) |
Hides other players' chat messages for you |
/togglementions |
chatcard.togglementions (everyone) |
Turns mentions on or off for you |
/chat is short for /chatcard. Mute and slow mode reset when the server restarts.
The vanilla commands /me and /teammsg (/tm) send chat that skips the mute, slow mode and filters, so ChatCard
turns them off for players and hides them from tab completion.
Permissions
| Permission |
Default |
Description |
chatcard.staff |
op |
Every staff command and bypass below |
chatcard.delete |
op |
See the delete button before chat messages |
chatcard.bypass.mute |
op |
Chat while the chat is muted |
chatcard.bypass.cooldown |
op |
No cooldown and no slow mode |
chatcard.bypass.filter |
op |
Skip the repeated message, caps and word filter |
chatcard.bypass.clear |
op |
Keep your chat when it is cleared |
chatcard.links |
op |
Send clickable links |
chatcard.chat.color |
op |
&a color codes and <red> color tags |
chatcard.chat.hex |
op |
&#RRGGBB and <#RRGGBB> hex colors |
chatcard.chat.gradient |
op |
<gradient:#FF0000:#0000FF> and <rainbow> |
chatcard.chat.format |
op |
&l &o &n &m &k and <bold>, <italic> ... |
chatcard.emojis |
everyone |
Emoji shortcuts |
chatcard.format.<name> |
nobody |
The permission you set on a chat format in config.yml |
Chat format permissions are not given to ops automatically. Give them with your permission plugin.
Configuration
chat:
formats:
vip:
permission: chatcard.format.vip
format: "%vault_prefix%{player}&7: &#FFE400{message}"
default:
permission: ""
format: "%vault_prefix%{player}&7: &f{message}"
delete-button: "&c✖ "
delete-hover: "&cDelete this message"
hover:
lines:
- "%luckperms_prefix%%player_name%"
- "&7------------"
- "�FF11$ &fMoney: �FF11%vault_eco_balance_formatted%"
- "&#A52CF5⭐ &fShards: &#A52CF5%shards%"
- "&#FF0000🗡 &fKills: &#FF0000%statistic_player_kills%"
- "&#FFE400⌚ &fPlaytime: &#FFE400%statistic_time_played%"
- "&#FA7600☠ &fDeaths: &#FA7600%statistic_deaths%"
- "&7------------"
click: "/msg %player_name%"
join:
message: "&8[&a+&8] &7{player}"
first-join: "<gradient:#FFE400:#FA7600>Welcome</gradient> &f{player} &7to the server!"
quit:
message: "&8[&c-&8] &7{player}"
death:
message: "&#FA7600☠ &7{message}"
mentions:
highlight: "&#FFE400@{name}"
sound: "entity.experience_orb.pickup"
volume: 1.0
pitch: 1.0
actionbar: "&#FFE400{player} &7mentioned you"
filter:
cooldown: 1.0
duplicate-seconds: 30
caps:
min-letters: 6
max-percent: 60
words:
- fuck
- shit
- ...
emojis:
":heart:": "❤"
":star:": "★"
":skull:": "☠"
...
clear-lines: 100
| Key |
Description |
chat.formats |
Checked from top to bottom. A player gets the first format whose permission they have. An empty permission matches everyone, so keep default last |
{player} |
The player's name with the hover card and the click command. Works in chat formats, join, quit and death messages |
{message} |
The chat message, or the vanilla death message in death.message |
chat.delete-button |
Shown before every chat message to players with chatcard.delete |
hover.lines |
The hover card. Placeholders are filled in for the player whose name it is |
hover.click |
The command the clicking player runs. Placeholders are filled in for the player whose name was clicked |
join.first-join |
Shown instead of join.message the first time a player joins |
mentions.highlight |
How a mention looks to the mentioned player. {name} is their name |
mentions.sound |
Any Minecraft sound, written as entity.experience_orb.pickup or ENTITY_EXPERIENCE_ORB_PICKUP |
mentions.actionbar |
{player} is the player who sent the message |
filter.cooldown |
Seconds between two messages of the same player |
filter.duplicate-seconds |
The same message again within this many seconds is blocked |
filter.caps |
A message with at least min-letters letters and more than max-percent capital letters is made lowercase |
filter.words |
Replaced with *. Matches whole words, any case, with repeated letters (shiiit) |
emojis |
Shortcut and the text it becomes |
clear-lines |
How many empty lines /chat clear sends |
Set a text to "" to turn it off. That works for join, quit, first-join, death, the delete button, the click
command, the mention highlight, sound and actionbar, and every line in messages.yml. hover.lines: [] turns the
hover card off.
Players' own messages never go through PlaceholderAPI, and only get colors with the permissions above. Tags like
<click> or <hover> always stay plain text.
Hover card size
Minecraft has no character limit on the hover card. The limit is the player's screen:
- Lines wrap at half the screen width. On a 1080p screen at the largest GUI scale, that is about 40 characters.
- A card taller than the screen is cut off. On a 1080p screen at the largest GUI scale, that is about 25 lines.
Keep the card under about 20 lines and it fits on every screen.
Message deletion
The delete button uses Minecraft's own message deletion, which only works on signed chat (online-mode=true with
enforce-secure-profile=true, the default). On servers without signed chat, or with a plugin that removes chat
signatures, the button is not shown.
Building
Requires JDK 25 or newer and Maven.
mvn package
The jar is written to target/.
Support
Ask on my Discord:
License
MIT
评论 0
登录后参与评分
还没有评论,来抢沙发吧