Modern Chat
对 1.8.9 聊天栏的全面重做,提供了来自现代版本游戏的众多功能以及各种 QoL(生活质量)改进。
最新版本:v1.1.2
清理了一些功能并更改了命令语法文件的读取系统。更多详情请参见更新日志。欢迎反馈您的想法!一如既往,请在 GitHub 上报告问题。
功能
本模组除了自带更改外,还整合了许多不同模组的功能:
其中许多功能也出现在 OBro1961 的 Chat Patches 模组中。然而,Chat Patches 仅兼容现代版本的 Minecraft。Modern Chat 专为 Legacy Fabric 1.8.9 构建。
配置概览
本模组高度可定制。要访问配置菜单,默认快捷键为 P。这可以在游戏控制设置中进行修改。
开发者概览
本模组也可以通过一定的技术知识手动配置。
自动补全系统
基于现代 Minecraft 的自动补全机制,本模组在输入行上方添加了一个聊天建议框,让您能更快地进行聊天!
按下 UP(上)和 DOWN(下)方向键可以选择不同的建议项,它们会自动填充到聊天框中。黄色高亮显示的即为当前选中的建议项。按下 Tab 键会将选中的建议项提交到输入行。
服务器命令自动补全
本模组的自动补全系统高度可配置。这支持各种命令语法树,使得自动补全建议能在拥有自定义命令的服务器上正常工作。
除了单人游戏的命令外,本模组还支持社区维护的服务器语法,您可以直接在游戏内菜单中通过几次点击安装。有关更多详细信息,请参阅 安装服务器语法。
支持的服务器会显示聊天自动补全建议,就像单人游戏命令一样,并具有其独特的颜色:

自动补全命令还支持 Tokens(令牌),这是触发解析引擎中特殊搜索的特定参数关键字。例如,如果我输入命令:
/give <player> <item>
这将触发两次令牌搜索。第一次令牌搜索 <player> 将获取标签菜单中所有活跃玩家的名字并将它们列为建议。目前不活跃的玩家仍然可以出现在这里(参见 好友名称自动补全)。接下来,<item> 将触发物品令牌搜索,显示游戏中所有可用的物品。
每个服务器都有一个唯一的 .json 文件,包含标识符和颜色,随后是语法树。模组读取此 .json 文件并解析它以生成自动补全建议。如果您希望查看更多关于格式的详细信息,请查看底部的 开发者详情。
好友名称自动补全
除了服务器命令外,好友名称也可以自动补全。每个服务器都有自己独特的好友列表。当命令语法请求玩家用户名作为输入(参数)时,自动补全模组会建议好友名称以进行自动补全。这在加速重复性命令时非常有用,例如向玩家发送消息、邀请他们加入队伍等,即使他们不在同一个大厅或尚未上线。
与服务器语法类似,好友名称也是从 .json 文件中读取的(尽管结构更简单)。有关更多详细信息,请阅读底部的 开发者详情。
平滑聊天动画
灵感来源于 Ezzenix 的 Chat Animation (Smooth Chat) 模组
Modern Chat 实现了打字行和聊天消息出现时的平滑动画效果。
在此处查看原版模组:
提升聊天位置
灵感来源于 Gnembon 的 Chat Up! 模组
本模组对聊天位置进行了简单的调整。为了防止与生命值和护甲条重叠,此调整提升了聊天的位置,使其不再遮挡这些元素的视野。
在此处查看原版模组:
扩展聊天记录
灵感来源于 JackFred 的 More Chat History 模组
Modern Chat 允许选项增加(或减少,如果您愿意的话)您的聊天记录长度,范围从 10 到 16384。现在您可以无限期地向上滚动而不用担心丢失您的消息!
在此处查看原版模组:
紧凑聊天刷屏
灵感来源于 Ruukas 的 ClearSpam 模组和 caoimhe 的 Compact Chat 模组
Modern Chat 通过将刷屏消息压缩为一行并添加一个简单的乘数来显示该消息被发送的次数,从而防止聊天中出现刷屏消息。
在此处查看原版模组:
替换尖括号
灵感来源于 Flytre7 的 No Angled Brackets 模组
在此查看原版模组:
保留聊天记录
灵感来源于 anar4732 的 Don't Clear Chat History 模组
通常情况下,离开世界或服务器会清除整个聊天记录,导致聊天窗口变为空白且无法找回之前说过的话。Modern Chat 通过阻止强制清空聊天来防止这种情况发生,从而保留你的聊天记录。
在此查看原版模组:
保留聊天输入
灵感来源于 spacebyte 的 LetMeSpeak 模组
在许多服务器上,游戏中的一些事件会在你打字时关闭聊天窗口。这可能会令人沮丧,因为它会擦除你的输入且无法恢复。Modern Chat 通过在聊天被强制关闭时保留消息来解决这个问题。按 Esc 和 Enter 键仍会正常关闭聊天窗口,不会保存内容。
注意: 由于 LetMeSpeak 是一个已经兼容 LegacyFabric 的模组,Modern Chat 充当了该模组的 替代 角色。
在此查看原版模组:
模组配置
如前所述,本模组提供了大量的自定义选项。要访问配置界面,请按 P(默认快捷键):
在这里,你可以切换以下我们在上面解释过的选项:
- 自动补全:
ON/OFF(开/关)
- 聊天记录:
10 - 16384
- 平滑聊天动画:
ON/OFF(开/关)
- 提升聊天栏高度:
ON/OFF(开/关)
- 紧凑聊天刷屏:
ON/OFF(开/关)
- 替换尖括号:
ON/OFF(开/关)
- 保留聊天记录:
ON/OFF(开/关)
- 保留聊天输入:
ON/OFF(开/关)
注意自动补全开关右侧的 "Customize..."(自定义...)按钮。在这里,我们可以找到关于自动补全逻辑的更深层次的自定义设置。
我们现在将深入探讨这三项内容。
建议颜色配置
回想一下前面提到的,每个服务器都有自己用于自动补全的 ID 和颜色。在这里,你可以修改每个服务器的自动补全建议的颜色。
要更改颜色,只需在列表中选择该服务器,然后在下方调整十六进制颜色值。颜色格式为:0xAARRGGBB,其中 AA 是透明度值(范围从 00 到 FF),RR 是红色值,GG 是绿色值,BB 是蓝色值。
完成颜色编辑后,点击 SAVE(保存)和 DONE(完成)以确认你的颜色调整。
也可以直接在配置文件 .json 中调整颜色;更多信息请参阅 开发详情。
好友列表配置
在这里,你可以自定义你的好友列表。如前所述,这些名称将在命令提示你输入玩家名字时作为建议出现,触发方式为 <player> 语法标记。
配置菜单左侧显示你的服务器列表,右侧显示你的好友列表。要添加好友,只需选择希望添加好友的目标服务器。选中后,该服务器的好友将显示在好友列表中。然后你可以通过输入他们的用户名(区分大小写)或使用 Copy From...(从...复制)按钮从其他服务器复制来添加好友。
可以通过点击每个用户名旁边的红色 [-] 按钮从列表中移除好友。
也可以通过直接修改 .json 文件来添加好友;更多信息请参阅 开发详情。
命令语法配置
最后,命令自动补全的语法本身也可以完全修改。
在左侧,我们有我们的服务器列表,就像好友菜单一样。在中间列,我们可以为选定的服务器选择特定的命令。最后,在右侧,我们可以在语法树中修改该命令的特定变体。
你可以选择一个变体进行编辑,或者选择“无”并添加新变体。
你可以通过按下每个变体旁边的红色 [-] 按钮来删除变体。你还可以为每个服务器删除和添加新命令。
服务器列标题左上角的 + 按钮打开语法浏览器——见下方的 安装服务器语法。
有关编写和编辑函数语法的更多细节,以及 .json 文件的工作原理,请参阅 开发详情。
安装服务器语法
模组默认仅安装了单人游戏语法。额外的服务器语法可以通过内置的语法浏览器安装,该浏览器直接从 GitHub 获取语法定义。
要打开语法浏览器,导航至 Command Syntax Configuration(命令语法配置)屏幕,并点击 Servers(服务器)列标题旁边的小 + 按钮。
这将打开 Add Server(添加服务器)屏幕,它会从 GitHub 加载可用语法列表。从列表中选择服务器并点击 Install(安装)以下载并将其语法保存到配置文件夹中。已安装的语法会用绿色的 Installed(已安装)标签标记。
也可以从这个相同的屏幕 卸载 语法。选择已安装的语法并点击 Uninstall(卸载)。系统会要求你确认,因为这也会删除该服务器的好友列表。卸载语法还会删除对该语法所做的任何自定义更改。
安装完成后,语法的行为与其他任何服务器语法完全相同。它可以通过标准配置菜单进行编辑、重新着色以及添加好友。
开发详情
这一部分非常长且过于技术化,不适合放在 Modrinth 上。如果你感兴趣,请查看 GitHub 上的源代码仓库。
更新
在可预见的未来,我将继续为该模组推出更新,随着新功能和错误修复的发现而不断迭代。
使用
虽然这是一个相当大的模组,我不确定你会如何将其融入你的项目中,但欢迎你在自己的项目中使用此模组或其任何代码。
Modern Chat
A total reworking of the 1.8.9 chat, providing tons of features from the modern game and various QoL improvements.
Latest Version: v1.1.2
Cleaned up a few of the features and changed the command syntax file reading system. For more details, see the changelog. Let me know your thoughts! As always, report issues on the GitHub
Features
This mod, in addition to its own changes, compiles features from many different mods into one:
Many of these features are also present in the Chat Patches mod by OBro1961. However, Chat Patches is only compatible with modern version of the game. Modern Chat is built for Legacy Fabric 1.8.9.
Configuration Overview
This mod is also highly customizable. To access the config menu, the default keybind is P. This can be modified in the game's control settings.
Developer Overview
This mod can also be configured manually with a little technical know-how.
Autocomplete System
Based on modern Minecraft's autocomplete, the mod adds a chat suggestion box above the typing line, allowing you to chat faster!
Pressing the UP and DOWN arrow keys allows you to select different suggestions, which are automatically filled in the chat box. The suggestion highlighted in yellow is the one that is currently selected. Pressing Tab will commit the selected suggestion to the typing line.
Server Command Autocomplete
The autocomplete system for this mod is highly configurable. This allows for various command syntax trees, allowing autocomplete suggestions to work on servers with custom commands.
In addition to singleplayer commands, the mod supports community-maintained server syntaxes that can be installed in a few clicks directly from the in-game menu. See Installing Server Syntaxes for more details.
Supported servers display chat autocomplete suggestions just like singleplayer commands, in their unique color:

The autocomplete commands also support Tokens, which are specific parameter keywords that trigger special searches in the parsing engine. For example, if I were to type the command:
/give <player> <item>
This would trigger two token searches. The first token search, <player>, will grab all active player names in the tab menu and list them as suggestions. Players who are not currently active can still appear here (see friend name autocomplete). Next, <item> will trigger an item token search, which will display all available items in the game.
Each server is given a unique .json file, containing an identifier and color, proceeded by the syntax tree. The mod reads this .json file and parses it to generate the autocomplete suggestions. If you wish to see more details regarding the format, take a look at the dev details near the bottom.
Friend Name Autocomplete
In addition to server commands, friend names can also be autocompleted. Each server gets its own unique friends list. When a command syntax requests a player username as an input (parameter), the autocomplete mod suggestions friend names to autocomplete. This is useful for speeding up repetitive commands, such as messaging a player, inviting them to a party, etc., when they are not in the same lobby as you or are not online.
Just like server syntaxes, friend names are also read from a .json file (albeit a much simpler one). For more details on this, read the dev details at the bottom.
Smooth Chat Animations
Inspired by the Chat Animation (Smooth Chat) mod by Ezzenix
Modern Chat implements a smooth animations for the typing line and chat messages as they appear.
Check out the original mod here:
Raise Chat
Inspired by the Chat Up! mod by Gnembon
This mod adds a simple tweak to the chat positioning. To prevent overlap with health and armor bars, this tweak raises the chat so it no longer obstructs view of these elements.
Check out the original mod here:
Extended Chat History
Inspired by the More Chat History mod by JackFred
Modern Chat allows an option to increase (or decrease, if you want) your chat history length, ranging from 10 to 16384. Now you can scroll back (pretty much) infinitely without worrying about losing your messages!
Check out the original mod here:
Compact Chat Spam
Inspired by the ClearSpam mod by Ruukas and the Compact Chat mod by caoimhe
Modern Chat prevents spam messages in the chat by compacting them into one line and adding a simple multiplier to show how many times that message has been sent.
Check out the original mods here:
Replace Angle Brackets
Inspired by the No Angled Brackets mod by Flytre7
Check out the original mod here:
Maintain Chat History
Inspired by the Don't Clear Chat History mod by anar4732
Normally, leaving worlds and servers wipes your entire chat history, leaving you with a blank chat window and no way to recover what was said. Modern Chat prevents this from happening by blocking forced chat clears, so your chat history remains preserved.
Check out the original mod here:
Preserve Chat Input
Inspired by the LetMeSpeak mod by spacebyte
On many servers, there are certain events in the game that can close your chat while you're typing. This can be frustrating, since it erases your chat and can't be restored. Modern Chat resolves this by preserving message when the chat is forcefully closed. Esc and Enter still close the chat normally, without saving it.
NOTE: since LetMeSpeak a mod that is already compatible with LegacyFabric, Modern Chat acts as a replacement for this mod.
Check out the original mod here:
Mod Configuration
As mentioned before, there is a lot of customization with this mod. To access the config screen, press P (default keybind):
Here, you can toggle the following options, which we explained above:
- Autocomplete:
ON/OFF
- Chat History:
10 - 16384
- Smooth Chat Animations:
ON/OFF
- Raise Chat:
ON/OFF
- Compact Chat Spam:
ON/OFF
- Replace Angle Brackets:
ON/OFF
- Maintain Chat History:
ON/OFF
- Preserve Chat Input:
ON/OFF
Notice the "Customize..." button to the right of the autocomplete toggle. Here, we can find much deeper customizations for the autocomplete logic.
We will now dive deeper into all three.
Suggestion Color Configuration
Remember from earlier that each server has its own id and color for the autocomplete. Here, you can modify the color of the autocomplete suggestions for each server.
To change a color, simply select that server in the list, then adjust the hex color in the space below. The color is formatted as: 0xAARRGGBB, where AA is the alpha value (ranging from 00 to FF), RR is the red value, GG is the green value, and BB is the blue value.
Once you are done editing the colors, hit SAVE and DONE to finalize your color adjustments.
Colors can also be adjusted directly in the config .json files; see dev details for more info.
Friend List Configuration
Here, you can customize your friends list. As mentioned before, these are the names that will appear as suggestions when a command prompts you to enter the name of a player, triggered by the <player> syntax token.
The config menu displays your servers list on the left and your friends list on the right. To add a friend, simply select the desired server you wish to add friends for. Once selected, the friends for that server will appear in the friends list. You can then add friends by typing their username (case sensitive) or copying from another server using the Copy From... button.
Friends can be removed from the list by clicking the red [-] next to each username.
Friends can be added directly by modifying the .json files; see dev details for more info.
Command Syntax Configuration
Finally, the command autocomplete syntaxes themselves can be modified in full.
On the left, we have our servers list, just like the friends menu. In the middle column, we can select a particular command for the selected server. Finally, on the right side, we can modify a specific variant of that command in the syntax tree.
You can select a variant to edit it, or select none and add a new variant.
You can delete variants by pressing the red [-] button next to each variant. You can also delete and add new commands for each server.
The + button in the top-left of the Servers column header opens the syntax browser — see Installing Server Syntaxes below.
For more details on writing and editing function syntaxes, as well as how the .json files work, see dev details.
Installing Server Syntaxes
The mod ships with only the singleplayer syntax installed by default. Additional servers can be installed through the in-game syntax browser, which fetches syntax definitions directly from GitHub.
To open the syntax browser, navigate to the Command Syntax Configuration screen and click the small + button next to the Servers column header.
This opens the Add Server screen, which loads a list of available syntaxes from the GitHub. Select a server from the list and click Install to download and save its syntax to your config folder. Installed syntaxes are marked with a green Installed label.
Syntaxes can also be uninstalled from this same screen. Select an installed syntax and click Uninstall. You will be asked to confirm, as this also removes the friend list for that server. Uninstalling a syntax also deletes any custom changes made to that syntax.
Once installed, a syntax behaves exactly like any other server syntax. It can be edited, recolored, and have friends added to it through the standard configuration menus.
Developer Details
This section is super long and too technical for Modrinth. If you're interested, check the source code repo on GitHub.
Updates
I'll keep rolling out updates for this mod for the foreseeable future, with new features and bug patches as they reveal themselves.
Usage
While this is a fairly large mod and I'm not sure where you'd fit it in, feel free to use this mod or any of its code in your own projects.
评论 0
登录后参与评分
还没有评论,来抢沙发吧