viaStyle
适用于 Minecraft 1.21.10 的服务端 Fabric 模组。将原版聊天系统替换为多频道设置,添加标签页列表样式、玩家专属昵称颜色、私聊、提及功能、社交监听,以及可选的 LuckPerms、BlockBot、Carpet、PAPI 和 BanHammer 集成。
无需安装客户端模组。
依赖要求
- Minecraft 1.21.10
- Fabric Loader >= 0.16.12
- Fabric API
可选依赖(在运行时自动检测):
- LuckPerms 前缀/后缀显示、基于权重的标签页排序、权限检查
- PlaceholderAPI (PAPI) 在格式字符串中使用
%placeholder% 占位符
- BlockBot Discord 桥接
- fabric-carpet Scarpet 事件集成与 HUD 日志记录器检测
- melius-vanish (DrexHD) 隐身玩家从建议列表和标签页列表中隐藏
安装
- 将
viastyle-<version>+mc1.21.10.jar 放入服务器的 mods/ 文件夹中。
- 启动服务器。默认配置文件将在
config/viaStyle/viaStyle.toml 生成。
- 根据需要编辑配置文件,然后在游戏内运行
/via reload 或重启服务器。
配置
所有设置均位于 config/viaStyle/viaStyle.toml。该文件为人类可读的 TOML 格式。缺失的键将在下次加载时填充默认值。所有设置也可以通过游戏内的 /via admin 面板在运行时更改。
[local]
| 键 |
默认值 |
描述 |
| radius |
100.0 |
可见范围(方块数) |
| trigger |
(空) |
进入本地模式的字符前缀;为空表示本地模式为默认频道 |
| prefix |
[L] |
附加到消息前的标签 |
| prefix_color |
GREEN |
前缀标签的颜色 |
| name_color |
GRAY |
玩家名称的颜色 |
| message_color |
GRAY |
消息文本的颜色 |
| format |
{timestamp}{prefix} {lp_prefix}{name}: {message} |
完整消息模板 |
| noone_heard |
false |
当范围内没有玩家时通知发送者 |
| noone_heard_message |
Nobody heard you. |
在此情况下向发送者显示的文本 |
[global]
| 键 |
默认值 |
描述 |
| trigger |
! |
将消息路由到全球聊天的字符前缀 |
| prefix |
[G] |
附加到消息前的标签 |
| prefix_color |
YELLOW |
前缀标签的颜色 |
| name_color |
WHITE |
玩家名称的颜色 |
| message_color |
WHITE |
消息文本的颜色 |
| format |
{timestamp}{prefix} {lp_prefix}{name}: {message} |
完整消息模板 |
[staff]
| 键 |
默认值 |
描述 |
| trigger |
\ |
工作人员聊天的字符前缀;为空则禁用 |
| prefix |
[Staff] |
附加到消息前的标签 |
| prefix_color |
RED |
前缀标签的颜色 |
| name_color |
WHITE |
玩家名称的颜色 |
| message_color |
DARK_RED |
消息文本的颜色 |
| format |
{timestamp}{prefix} {lp_prefix}{name}: {message} |
完整消息模板 |
[timestamp]
| 键 |
默认值 |
描述 |
| show_timestamp |
false |
在每个消息前添加时间戳 |
| timestamp_format |
HH:mm |
Java DateTimeFormatter 模式 |
| timestamp_color |
DARK_GRAY |
时间戳的颜色 |
[integrations]
| 键 |
默认值 |
描述 |
| use_placeholder_api |
true |
启用 PlaceholderAPI 支持 |
| use_ban_hammer |
true |
启用 BanHammer 集成 |
| use_luck_perms |
true |
启用 LuckPerms 集成 |
| use_scarpet_events |
false |
在每次聊天消息时触发 PLAYER_MESSAGE Scarpet 事件 |
[blockbot]
| 键 |
默认值 |
描述 |
| bridge_mode |
auto |
当加载了 BlockBot 时启用桥接;none 禁用它 |
| global_channel |
chat |
用于全球聊天中继的 BlockBot 频道名称 |
| local_channel |
(空) |
用于本地聊天的 BlockBot 频道;为空则禁用 |
| discord_format |
[Discord] {message} |
当 passthrough 为 false 时应用的格式 |
| passthrough |
true |
true BlockBot 原生格式化 Discord 到 MC 的消息;false viaStyle 应用 discord_format |
| discord_mention_ping |
true |
扫描广播消息并在提到玩家名称时触发游戏内提示音 |
| discord_mention_mappings |
(空) |
手动设置的 MinecraftName:DiscordUserId 对,以逗号分隔 |
[pm]
| 键 |
默认值 |
描述 |
| allow_self_message |
false |
允许玩家给自己发 /msg |
| sender_format |
[PM -> {receiver}] {message} |
发送给发送者的格式 |
| receiver_format |
[PM <- {sender}] {message} |
发送给接收者的格式 |
| color |
LIGHT_PURPLE |
私聊消息的颜色 |
[nickcolor]
| 键 |
默认值 |
描述 |
| enabled |
true |
昵称颜色系统的总开关 |
| in_chat |
true |
在聊天消息中应用昵称颜色 |
| in_tab |
true |
在标签页列表中应用昵称颜色 |
| in_nametag |
true |
在头顶名牌上应用昵称颜色 |
| nametag_show_lp_prefix |
true |
在名牌中包含 LuckPerms 前缀 |
| nametag_mode |
display |
display TextDisplay 实体(全 RGB);team 16 种原版颜色 |
| nametag_color_strategy |
first |
如何从渐变中选择颜色:first 或 average |
| nametag_orphan_scan_enabled |
true |
定期移除遗留的 TextDisplay 实体 |
| nametag_orphan_scan_interval_ticks |
200 |
扫描间隔(刻) |
[tablist]
| 键 |
默认值 |
描述 |
| sort_mode |
normal |
normal 更高的 LP 权重排在更后;reverse 更高排在更前;none 禁用 |
| sort_spectators_to_bottom |
false |
将观察者推至所有其他玩家下方 |
[mentions]
| 键 |
默认值 |
描述 |
| enabled |
true |
处理聊天中的 @PlayerName 提及 |
| sound |
true |
在被提及玩家的客户端播放声音 |
| bold |
false |
在消息中将 @mention 加粗 |
| color |
GOLD |
提及的高亮颜色 |
[language]
| 键 |
默认值 |
描述 |
| default_language |
en |
UI 语言;en 或 ru |
[joinleave]
| key |
默认值 |
描述 |
| join_format |
&a+ &r{name} |
玩家加入时的广播格式 |
| leave_format |
&c- &r{name} |
玩家离开时的广播格式 |
| first_join_format |
&6+ &r{name} &6首次加入! |
仅在玩家首次加入时显示 |
[console]
| key |
默认值 |
描述 |
| log_global_to_console |
true |
将全局聊天转发至服务器控制台 |
| log_local_to_console |
true |
转发本地聊天 |
| log_staff_to_console |
true |
转发员工聊天 |
| log_privates_to_console |
true |
转发私聊消息 |
格式令牌
大多数格式字符串支持以下令牌:
| 令牌 |
值 |
{name} |
玩家显示名称 |
{message} |
消息内容 |
{prefix} |
频道前缀标签 |
{timestamp} |
时间戳(禁用时为空) |
{lp_prefix} |
LuckPerms 前缀 |
{lp_suffix} |
LuckPerms 后缀 |
所有格式字符串均支持旧版 & 颜色代码和十六进制颜色 (&#RRGGBB)。MiniMessage 风格标签 (<red>, <bold>, <gr:#ff0000:#ffaa00>) 可在昵称颜色值及 viaSuper 格式字符串中使用。
功能
聊天频道
本地聊天仅对配置半径内的玩家可见。全局聊天覆盖所有玩家。员工聊天仅限拥有 viastyle.staff 权限节点的玩家使用。可以通过 /chatmode 切换每个玩家的活跃默认频道。
启用 noone_heard 后,如果没有其他玩家在范围内,发送者会收到一条私人提示。
私聊
/msg <player> <message>(别名 /m, /w)发送私聊消息。/reply(别名 /r)回复最后给你发消息的人。被屏蔽的玩家无法发送私聊。隐身玩家不会出现在建议列表中。
@提及
在任何消息中输入 @PlayerName 以高亮显示并在接收者的客户端播放声音。使用部分匹配:@via 可以匹配 viaMeowts。
安装 BlockBot 后,在游戏中输入 @MinecraftName 可以解析为 Discord 用户 ID,从而使 Discord 将其渲染为真正的 Ping 通知。映射可以在 discord_mention_mappings 中手动配置,也可以从传入的 Discord 消息自动填充。
屏蔽系统
/ignore <player> 切换屏蔽状态。被屏蔽玩家的聊天和私聊消息会被静默丢弃。状态在重启后保持。
社交间谍
/socialspy(需要 viastyle.socialspy 权限)在全服范围内拦截私聊消息。员工可以从任意距离监控本地频道和员工频道。
昵称颜色
玩家通过 /nickcolor <colour> 设置颜色。接受命名颜色、十六进制代码 (#rrggbb) 和渐变语法 (#ff0000:#ffaa00)。存储在 config/viaStyle/nickcolors.json 中。
颜色应用于聊天列表、标签页列表以及悬浮的 TextDisplay 名字标签。管理员可以使用 /nickcolor <player> <colour|reset> 设置或清除任何玩家的颜色。
nametag_mode = display 将名字标签渲染为 TextDisplay 实体(完整 RGB)。nametag_mode = team 使用记分板队伍(16 种原版颜色,兼容性更好)。
标签页列表
viaStyle 每个刻向每位玩家发送自定义的头文件和尾文件。模板位于 config/viaStyle/tablist.json。拥有活跃 Carpet HUD 记录器(如 /log tps, /log mobcaps 等)的玩家会自动排除在更新之外。
标签页排序顺序由 sort_mode 控制,并在可用时使用 LuckPerms 权重。
加入 / 离开消息
原版的加入和离开广播被替换为配置的格式。玩家首次加入时会广播单独的格式。
viaSuper
/viasuper [text] 发送戏剧性的标题/副标题广播。短单词作为大标题显示;较长的单词(长度 >= viaSuperSubtitleLength)作为副标题显示。viaSuperTitleFormat 和 viaSuperSubtitleFormat 支持 MiniMessage 格式化和渐变。
Discord 桥接 (BlockBot)
当安装 BlockBot 时,viaStyle 通过 ChatMessageEvent 并将 sendRelayMessage 作为回退机制,将 Minecraft 聊天中继到 Discord。通过反射自动检测现代和旧版 BlockBot API 包。
设置 passthrough = true(默认)让 BlockBot 原生处理 Discord 到 Minecraft 的格式化。设置 passthrough = false 则使用 viaStyle 的 discord_format。
BanHammer
加载 BanHammer 后,被封禁的玩家尝试聊天时会收到标准的 BanHammer 消息。
Carpet / Scarpet 集成
设置 useScarpetEvents = true 以便 viaStyle 在处理每条消息时触发 Carpet 的 PLAYER_MESSAGE 事件。Scarpet 脚本可以拦截、修改或取消消息。Carpet HUD 记录器检测不受此设置影响。
命令
| 命令 |
权限 |
描述 |
/via reload |
viastyle.admin |
从磁盘重新加载配置 |
/via admin |
viastyle.admin |
打开游戏内管理面板 |
/msg <player> <message> |
any |
发送私聊消息 |
/reply <message> |
any |
回复最后的私聊发送者 |
/chatmode |
any |
切换默认频道(本地 / 全局) |
/ignore <player> |
any |
切换屏蔽某玩家 |
/nickcolor [player] <colour|reset> |
viastyle.nickcolor / viastyle.admin |
设置或清除昵称颜色 |
/socialspy |
viastyle.socialspy |
切换社交间谍模式 |
/viasuper [text] |
viastyle.admin |
广播标题/副标题消息 |
权限
| 节点 |
描述 |
viastyle.admin |
完全管理访问:配置重载、管理面板、viasuper、设置其他玩家的昵称颜色 |
viastyle.staff |
写入和读取员工聊天 |
viastyle.socialspy |
切换社交间谍 |
viastyle.nickcolor |
设置自己的昵称颜色 |
Scarpet 脚本
在配置中启用 use_scarpet_events = true。viaStyle 会为每条消息触发 Carpet 的 PLAYER_MESSAGE 事件。脚本可以返回 'cancel' 来抑制消息,或返回修改后的字符串来替换内容。
tools/scarpet_generator.py 生成以下模板:
| 脚本 |
描述 |
viastyle_logger.sc |
将带时间戳的消息记录到文件中 |
viastyle_antispam.sc |
按玩家限流 |
viastyle_filter.sc |
屏蔽词/审查器 |
viastyle_discord.sc |
用于外部 Discord 机器人的队列文件中继 |
viastyle_welcome.sc |
加入时的 MOTD(服务器公告) |
viastyle_commands.sc |
以哈希前缀开头的聊天内命令(#help、#roll、#tps) |
viastyle_stats.sc |
按玩家统计消息和字数 |
python tools/scarpet_generator.py --all --out /path/to/scripts
将生成的 .sc 文件复制到 <world>/scripts/,并使用 /script load <name> 加载。
许可证
MIT。详见 LICENSE。
viaStyle
Server-side Fabric mod for Minecraft 1.21.10. Replaces the vanilla chat system with a multi-channel setup, adds tab list styling, per-player nick colours, private messages, mentions, social spy, and optional integrations with LuckPerms, BlockBot, Carpet, PAPI, and BanHammer.
No client mod required.
Requirements
- Minecraft 1.21.10
- Fabric Loader >= 0.16.12
- Fabric API
Optional dependencies (auto-detected at runtime):
- LuckPerms prefix/suffix display, weight-based tab sorting, permission checks
- PlaceholderAPI (PAPI) use
%placeholder% tokens in format strings
- BlockBot Discord bridge
- fabric-carpet Scarpet event integration and HUD logger detection
- melius-vanish (DrexHD) vanished players are hidden from suggestions and tab list
Installation
- Drop
viastyle-<version>+mc1.21.10.jar into the server's mods/ folder.
- Start the server. A default config is generated at
config/viaStyle/viaStyle.toml.
- Edit the config as needed, then run
/via reload in-game or restart the server.
Configuration
All settings live in config/viaStyle/viaStyle.toml. The file is human-readable TOML. Missing keys are filled with defaults on next load. All settings can also be changed at runtime through the /via admin panel.
[local]
| key |
default |
description |
| radius |
100.0 |
Visibility range in blocks |
| trigger |
(empty) |
Prefix char to enter local mode empty means local is the default channel |
| prefix |
[L] |
Tag prepended to messages |
| prefix_color |
GREEN |
Color of the prefix tag |
| name_color |
GRAY |
Color of the player name |
| message_color |
GRAY |
Color of the message text |
| format |
{timestamp}{prefix} {lp_prefix}{name}: {message} |
Full message template |
| noone_heard |
false |
Notify the sender when no player is within range |
| noone_heard_message |
Nobody heard you. |
Text shown to the sender in that case |
[global]
| key |
default |
description |
| trigger |
! |
Prefix char to route a message to global chat |
| prefix |
[G] |
Tag prepended to messages |
| prefix_color |
YELLOW |
Color of the prefix tag |
| name_color |
WHITE |
Color of the player name |
| message_color |
WHITE |
Color of the message text |
| format |
{timestamp}{prefix} {lp_prefix}{name}: {message} |
Full message template |
[staff]
| key |
default |
description |
| trigger |
\ |
Prefix char for staff chat empty to disable |
| prefix |
[Staff] |
Tag prepended to messages |
| prefix_color |
RED |
Color of the prefix tag |
| name_color |
WHITE |
Color of the player name |
| message_color |
DARK_RED |
Color of the message text |
| format |
{timestamp}{prefix} {lp_prefix}{name}: {message} |
Full message template |
[timestamp]
| key |
default |
description |
| show_timestamp |
false |
Prepend a timestamp to each message |
| timestamp_format |
HH:mm |
Java DateTimeFormatter pattern |
| timestamp_color |
DARK_GRAY |
Color of the timestamp |
[integrations]
| key |
default |
description |
| use_placeholder_api |
true |
Enable PlaceholderAPI support |
| use_ban_hammer |
true |
Enable BanHammer integration |
| use_luck_perms |
true |
Enable LuckPerms integration |
| use_scarpet_events |
false |
Fire PLAYER_MESSAGE Scarpet events on every chat message |
[blockbot]
| key |
default |
description |
| bridge_mode |
auto |
auto enables the bridge when BlockBot is loaded, none disables it |
| global_channel |
chat |
BlockBot channel name used for global chat relay |
| local_channel |
(empty) |
BlockBot channel for local chat empty to disable |
| discord_format |
[Discord] {message} |
Format applied when passthrough is false |
| passthrough |
true |
true BlockBot formats Discord to MC messages natively; false viaStyle applies discord_format |
| discord_mention_ping |
true |
Scan broadcast messages and trigger an in-game ping when a player name is mentioned |
| discord_mention_mappings |
(empty) |
Manual MinecraftName:DiscordUserId pairs, comma-separated |
[pm]
| key |
default |
description |
| allow_self_message |
false |
Allow players to /msg themselves |
| sender_format |
[PM -> {receiver}] {message} |
Format shown to the sender |
| receiver_format |
[PM <- {sender}] {message} |
Format shown to the receiver |
| color |
LIGHT_PURPLE |
Color of PM messages |
[nickcolor]
| key |
default |
description |
| enabled |
true |
Master toggle for the nick colour system |
| in_chat |
true |
Apply nick colour to chat messages |
| in_tab |
true |
Apply nick colour in the tab list |
| in_nametag |
true |
Apply nick colour to the above-head nametag |
| nametag_show_lp_prefix |
true |
Include the LuckPerms prefix in the nametag |
| nametag_mode |
display |
display TextDisplay entity (full RGB); team 16 vanilla colours |
| nametag_color_strategy |
first |
How to pick a colour from gradients: first or average |
| nametag_orphan_scan_enabled |
true |
Periodically remove leftover TextDisplay entities |
| nametag_orphan_scan_interval_ticks |
200 |
Scan interval in ticks |
[tablist]
| key |
default |
description |
| sort_mode |
normal |
normal higher LP weight goes lower; reverse higher goes higher; none disabled |
| sort_spectators_to_bottom |
false |
Push spectators below all other players |
[mentions]
| key |
default |
description |
| enabled |
true |
Process @PlayerName mentions in chat |
| sound |
true |
Play a sound on the mentioned player client |
| bold |
false |
Bold the @mention in the message |
| color |
GOLD |
Highlight colour for mentions |
[language]
| key |
default |
description |
| default_language |
en |
UI language en or ru |
[joinleave]
| key |
default |
description |
| join_format |
&a+ &r{name} |
Broadcast format when a player joins |
| leave_format |
&c- &r{name} |
Broadcast format when a player leaves |
| first_join_format |
&6+ &r{name} &6joined for the first time! |
Shown only on first join |
[console]
| key |
default |
description |
| log_global_to_console |
true |
Forward global chat to the server console |
| log_local_to_console |
true |
Forward local chat |
| log_staff_to_console |
true |
Forward staff chat |
| log_privates_to_console |
true |
Forward private messages |
Format tokens
Most format strings support these tokens:
| token |
value |
{name} |
Player display name |
{message} |
Message content |
{prefix} |
Channel prefix tag |
{timestamp} |
Timestamp (empty when disabled) |
{lp_prefix} |
LuckPerms prefix |
{lp_suffix} |
LuckPerms suffix |
Legacy &-colour codes and hex colours (&#RRGGBB) are supported in all format strings. MiniMessage-style tags (<red>, <bold>, <gr:#ff0000:#ffaa00>) are supported in nick colour values and viaSuper format strings.
Features
Chat channels
Local chat is visible only within the configured radius. Global chat reaches every player. Staff chat is limited to players with the viastyle.staff permission node. The active default channel can be toggled per-player with /chatmode.
When noone_heard is enabled, the sender receives a private hint if no other player was in range.
Private messages
/msg <player> <message> (aliases /m, /w) sends a private message. /reply (alias /r) replies to the last person who wrote to you. Ignored players cannot send PMs. Vanished players are excluded from suggestions.
@Mentions
Type @PlayerName in any message to highlight it and play a sound on the recipient's client. Partial matching is used @via matches viaMeowts.
When BlockBot is installed, typing @MinecraftName in-game can resolve to a Discord user ID so Discord renders it as a real ping. The mapping can be configured manually in discord_mention_mappings or populated automatically from incoming Discord messages.
Ignore system
/ignore <player> toggles ignoring. An ignored player's messages and PMs are silently dropped. State persists across restarts.
Social Spy
/socialspy (requires viastyle.socialspy) intercepts private messages server-wide. Staff can monitor local and staff channels from any distance.
Nick colours
Players set a colour via /nickcolor <colour>. Accepts named colours, hex codes (#rrggbb), and gradient syntax (#ff0000:#ffaa00). Stored in config/viaStyle/nickcolors.json.
The colour applies to chat, the tab list, and the floating TextDisplay nametag. Admins can set or clear any player's colour with /nickcolor <player> <colour|reset>.
nametag_mode = display renders nametags as TextDisplay entities (full RGB). nametag_mode = team uses scoreboard teams (16 vanilla colours, better compatibility).
Tab list
viaStyle sends a custom header and footer to every player each tick. Templates live in config/viaStyle/tablist.json. Players with active Carpet HUD loggers (/log tps, /log mobcaps, etc.) are excluded from updates automatically.
Tab sort order is controlled by sort_mode and uses LuckPerms weight when available.
Join / leave messages
Vanilla join and leave broadcasts are replaced with the configured formats. A separate format is broadcast on a player's very first join.
viaSuper
/viasuper [text] sends a dramatic title/subtitle broadcast. Short words appear as a large title; longer words (length >= viaSuperSubtitleLength) appear as a subtitle. MiniMessage formatting and gradients are supported in viaSuperTitleFormat and viaSuperSubtitleFormat.
Discord bridge (BlockBot)
When BlockBot is installed, viaStyle relays Minecraft chat to Discord via ChatMessageEvent with sendRelayMessage as a fallback. Both modern and legacy BlockBot API packages are detected automatically via reflection.
Set passthrough = true (default) to let BlockBot handle Discord-to-Minecraft formatting natively. Set passthrough = false to use viaStyle's discord_format instead.
BanHammer
When BanHammer is loaded, players who attempt to chat while banned receive the standard BanHammer message.
Carpet / Scarpet integration
Set useScarpetEvents = true to fire Carpet's PLAYER_MESSAGE event for every message viaStyle processes. Scarpet scripts can intercept, modify, or cancel messages. Carpet HUD logger detection runs regardless of this setting.
Commands
| command |
permission |
description |
/via reload |
viastyle.admin |
Reload config from disk |
/via admin |
viastyle.admin |
Open the in-game admin panel |
/msg <player> <message> |
any |
Send a private message |
/reply <message> |
any |
Reply to the last PM sender |
/chatmode |
any |
Toggle default channel (local / global) |
/ignore <player> |
any |
Toggle ignoring a player |
/nickcolor [player] <colour|reset> |
viastyle.nickcolor / viastyle.admin |
Set or clear nick colour |
/socialspy |
viastyle.socialspy |
Toggle social spy |
/viasuper [text] |
viastyle.admin |
Broadcast a title/subtitle message |
Permissions
| node |
description |
viastyle.admin |
Full admin access: config reload, admin panel, viasuper, set other players nick colours |
viastyle.staff |
Write and read staff chat |
viastyle.socialspy |
Toggle social spy |
viastyle.nickcolor |
Set your own nick colour |
Scarpet scripts
Enable use_scarpet_events = true in the config. viaStyle fires Carpet's PLAYER_MESSAGE event for each message. A script can return 'cancel' to suppress the message or return a modified string to replace the content.
tools/scarpet_generator.py generates the following templates:
| script |
description |
viastyle_logger.sc |
Log messages to a file with timestamps |
viastyle_antispam.sc |
Per-player rate limiter |
viastyle_filter.sc |
Word blocker / censor |
viastyle_discord.sc |
Queue-file relay for external Discord bots |
viastyle_welcome.sc |
MOTD on join |
viastyle_commands.sc |
Hash-prefixed in-chat commands (#help, #roll, #tps) |
viastyle_stats.sc |
Per-player message and word count tracker |
python tools/scarpet_generator.py --all --out /path/to/scripts
Copy generated .sc files to <world>/scripts/ and load with /script load <name>.
License
MIT. See LICENSE.
评论 0
登录后参与评分
还没有评论,来抢沙发吧