BetterChat
适用于 Paper/Purpur 26.3 — Java 25 — 版本 2.1.0
BetterChat 使用 MiniMessage 格式重写了服务器的聊天、加入、离开和首次加入消息。它内置了占位符,可选支持 PlaceholderAPI 和 ServerRoles 集成,以及提及高亮系统——所有配置均通过一个注释详尽的 config.yml 文件进行驱动。
消息管道默认设计为安全模式:玩家输入的消息会被转义并最后插入,因此普通玩家无法在聊天中注入颜色、格式标签或占位符。
功能
- MiniMessage 聊天格式 — 在配置的格式字符串中完全支持渐变、颜色、装饰和重置。
- 加入/离开/首次加入消息 — 每项均可独立切换,并完全支持格式化。
- 内置占位符 —
{player}、{displayname}、{world}、{online}、{message}。
- 可选 PlaceholderAPI 支持 — 当安装了 PlaceholderAPI 时,可在格式字符串中使用任何
%placeholder%(例如 %serverroles_prefix_formatted%)。
- 可选 ServerRoles 集成 — 通过 PlaceholderAPI 提供角色前缀和颜色。
- 提及高亮 —
@name 会以可配置的颜色和声音高亮显示被提及的玩家。
- 安全消息处理 — 玩家消息内容不经过 PlaceholderAPI 处理,除非玩家拥有格式权限,否则会被转义。
- 基于权限的格式化 — 只有拥有
betterchat.format 权限的玩家才能在自身消息中使用 MiniMessage 标签。
- 双语语言文件 — 包含
en_US 和 pt_PT。
- 游戏内格式调试 — 逐步检查占位符解析管道。
命令
| 命令 |
描述 |
权限 |
/betterchat |
显示命令用法。 |
(无) |
/betterchat reload |
重新加载配置文件和语言文件,重新检测 PlaceholderAPI。 |
betterchat.admin |
/betterchat debugpapi [player] |
打印玩家的占位符解析管道。 |
betterchat.admin |
/betterchat debugformat [player] |
打印玩家已解析的聊天/加入/离开格式。 |
betterchat.admin |
别名:/bchat。
权限
| 节点 |
描述 |
默认值 |
betterchat.admin |
访问 /betterchat 管理子命令(reload, debugpapi, debugformat)。 |
op |
betterchat.format |
允许玩家在自身的聊天消息中使用 MiniMessage 格式标签。 |
false |
关于 betterchat.format 的说明:授予此节点允许玩家在消息中使用 MiniMessage 标签。仅将其授予可信玩家。没有该权限的玩家其标签会被自动转义,因此他们的消息内容始终以字面形式显示。
配置
默认 config.yml:
language: en_US
features:
chat-format: true
join-quit-messages: true
first-join-message: true
# If true, players with betterchat.format can use MiniMessage tags in their messages.
allow-message-minimessage-with-permission: true
mention-highlight:
enabled: true
sound: "entity.experience_orb.pickup"
format: "<yellow>@{mentioned}</yellow>"
formats:
# Supports both built-in {placeholders} and PlaceholderAPI %placeholders%.
chat: "%serverroles_prefix_formatted% %serverroles_color%{player}<reset>: <white>{message}</white>"
join: "<green>+ <gray>{player}</gray></green>"
quit: "<red>- <gray>{player}</gray></red>"
first-join: "<gold>* <gray>{player}</gray> <yellow>joined for the first time!</yellow></gold>"
debug:
papi: false
placeholder-flow: false
关键点:
- 占位符 — 内置的
{...} 占位符优先解析,然后是 PlaceholderAPI 的 %...%,最后是 {message} 的插入(仅限聊天)。消息内容不经过 PlaceholderAPI 处理,从而防止从聊天中注入占位符。
formats.chat — 默认格式通过 PlaceholderAPI 使用 ServerRoles 占位符。如果您未运行 PlaceholderAPI,请将其替换为纯文本格式,例如 "<gray>{player}</gray>: <white>{message}</white>"。
mention-highlight — 设置 sound: "" 以禁用提及音效。
debug — 正常操作时保持两项关闭;placeholder-flow 会输出非常详细的日志。
安装
- 需要 Paper 或 Purpur 26.3 以及 Java 25(2.0.0 运行于 26.2,1.x 运行于 1.21.x)。
- (可选但推荐)如果您的格式字符串使用
%...% 占位符或 ServerRoles 集成,请安装 PlaceholderAPI。
- 将
BetterChat.jar 放入服务器的 plugins/ 文件夹。
- 启动服务器一次以生成
config.yml 和语言文件。
- 根据需要编辑
config.yml 并运行 /betterchat reload。
依赖
- PlaceholderAPI(可选) — 仅在您的格式中使用
%...% 占位符(包括默认的基于 ServerRoles 的聊天格式)时需要。如果没有它,内置的 {...} 占位符和 MiniMessage 仍然有效;任何 %...% 令牌将保持未解析状态。
- ServerRoles(可选) — 通过 PlaceholderAPI 提供角色前缀/颜色占位符。
支持 / 源码
源代码:
BetterChat
For Paper/Purpur 26.3 — Java 25 — Version 2.1.0
BetterChat rewrites your server's chat, join, quit and first-join messages using
MiniMessage formatting. It ships with
built-in placeholders, optional PlaceholderAPI and ServerRoles integration, and a mention
highlight system — all driven from a single, well-commented config.yml.
The message pipeline is designed to be safe by default: player-typed messages are escaped and
inserted last, so a normal player cannot inject colors, formatting tags, or placeholders
into chat.
Features
- MiniMessage chat formatting — full gradient, color, decoration and reset support in your
configured format string.
- Join / quit / first-join messages — each independently toggleable and fully formatted.
- Built-in placeholders —
{player}, {displayname}, {world}, {online}, {message}.
- Optional PlaceholderAPI support — use any
%placeholder% in your format strings when
PlaceholderAPI is installed (for example %serverroles_prefix_formatted%).
- Optional ServerRoles integration — role prefixes and colors via PlaceholderAPI.
- Mention highlighting —
@name highlights the mentioned player with a configurable color
and sound.
- Safe message handling — player message content never passes through PlaceholderAPI, and
is escaped unless the player has the formatting permission.
- Permission-gated formatting — only players with
betterchat.format may use MiniMessage
tags in their own messages.
- Bilingual language files —
en_US and pt_PT included.
- In-game format debugging — inspect the placeholder resolution pipeline step by step.
Commands
| Command |
Description |
Permission |
/betterchat |
Show command usage. |
(none) |
/betterchat reload |
Reload config and language files, re-detect PlaceholderAPI. |
betterchat.admin |
/betterchat debugpapi [player] |
Print the placeholder resolution pipeline for a player. |
betterchat.admin |
/betterchat debugformat [player] |
Print the resolved chat/join/quit formats for a player. |
betterchat.admin |
Alias: /bchat.
Permissions
| Node |
Description |
Default |
betterchat.admin |
Access to /betterchat admin subcommands (reload, debugpapi, debugformat). |
op |
betterchat.format |
Allows using MiniMessage formatting tags in the player's own chat messages. |
false |
Note on betterchat.format: granting this node lets a player use MiniMessage tags in their
messages. Only grant it to trusted players. Players without it have their tags escaped
automatically, so their message content is always shown literally.
Configuration
The default config.yml:
language: en_US
features:
chat-format: true
join-quit-messages: true
first-join-message: true
# If true, players with betterchat.format can use MiniMessage tags in their messages.
allow-message-minimessage-with-permission: true
mention-highlight:
enabled: true
sound: "entity.experience_orb.pickup"
format: "<yellow>@{mentioned}</yellow>"
formats:
# Supports both built-in {placeholders} and PlaceholderAPI %placeholders%.
chat: "%serverroles_prefix_formatted% %serverroles_color%{player}<reset>: <white>{message}</white>"
join: "<green>+ <gray>{player}</gray></green>"
quit: "<red>- <gray>{player}</gray></red>"
first-join: "<gold>* <gray>{player}</gray> <yellow>joined for the first time!</yellow></gold>"
debug:
papi: false
placeholder-flow: false
Key points:
- Placeholders — built-in
{...} placeholders are resolved first, then PlaceholderAPI
%...%, and finally {message} is inserted (chat only). Message content never passes through
PlaceholderAPI, which prevents placeholder injection from chat.
formats.chat — the default format uses ServerRoles placeholders via PlaceholderAPI. If you
do not run PlaceholderAPI, replace it with a plain format such as
"<gray>{player}</gray>: <white>{message}</white>".
mention-highlight — set sound: "" to disable the mention sound.
debug — leave both off in normal operation; placeholder-flow is very verbose.
Installation
- Requires Paper or Purpur 26.3 and Java 25 (2.0.0 runs on 26.2, 1.x on 1.21.x).
- (Optional but recommended) install PlaceholderAPI if your format strings use
%...%
placeholders or ServerRoles integration.
- Drop
BetterChat.jar into your server's plugins/ folder.
- Start the server once to generate
config.yml and the language files.
- Edit
config.yml to taste and run /betterchat reload.
Dependencies
- PlaceholderAPI (optional) — required only if you use
%...% placeholders in your formats,
including the default ServerRoles-based chat format. Without it, built-in {...} placeholders
and MiniMessage still work; any %...% tokens are left unresolved.
- ServerRoles (optional) — provides role prefix/color placeholders through PlaceholderAPI.
Support / Source
Source code:
评论 0
登录后参与评分
还没有评论,来抢沙发吧