(English introduction is located at the bottom.)
一个简易的翻译模组,可翻译聊天栏与聊天输入框
面向中文用户,支持中文至七种语言(输入框)与任意语言至中文(聊天消息)的翻译
最开始是做给自己用的,现在分享出来,说不定也有人用得上
完全使用OpenCode制作,我本人不会java
使用方法
模组需配置API Key才能正常运作,配置文件位于config/chat_translation.json
支持OpenAI API兼容格式的服务
示例:
{
"baseUrl": "https://api.deepseek.com",
"apiKey": "",
"model": "deepseek-v4-flash"
}
功能介绍
输入框翻译
通过点击聊天输入框右侧的“翻译”按钮,可以将输入框中的文本翻译为英文
点击“目标:X”按钮可切换目标语言,默认为英语。当前支持英语、法语、德语、西班牙语、日语、韩语和俄语
聊天栏翻译
通过点击聊天消息旁的“翻译”按钮,可将消息翻译为中文。译文会显示在原文下方
自动翻译
可在配置文件中通过autoTranslate开关,也可以在游戏中通过/auto_translate true/false快速开关
同tick发送的多条消息只会显示一个按钮,可通过配置文件中的batchMessages true/false开关
自动翻译开启后将不会显示“翻译”按钮
思考模式开关与思考强度
仅适配DeepSeek API
配置选项:
thinkingMode off / auto / on
thinkingEffort low / high / max
示例:
{
"thinkingMode": "off",
"thinkingEffort": "low"
}
其他
可通过translationMarker自定义在译文(仅聊天栏消息)末尾添加的标记,留空将不添加
minChineseChars控制最大中文字符数量,超过设定值将不会被自动翻译或添加按钮。默认值为3
注意,翻译请求会发送至配置文件中指定的API服务
请保管好你的API Key,切勿分享给任何人
如果遇到问题,可以在Discord联系我
English introduction:
A simple translation mod that translates the chat bar and chat input box.
Designed for Chinese-speaking users, it supports translation from Chinese into seven languages (input box) and from any language into Chinese (chat messages).
It was originally made for my own use, but now I'm sharing it in case someone else might find it useful.
It is built entirely with OpenCode — I don't know Java myself.
Usage
The mod requires an API Key to function properly. The configuration file is located at config/chat_translation.json.
Supports services compatible with the OpenAI API format.
Example:
{
"baseUrl": "https://api.deepseek.com",
"apiKey": "",
"model": "deepseek-v4-flash"
}
Features
Input Box Translation
By clicking the "翻译" button on the right side of the chat input box, the text in the input box will be translated into English.
Click the "目标: X" button to switch the target language. The default is English. Currently supported languages: English, French, German, Spanish, Japanese, Korean, and Russian.
Chat Message Translation
By clicking the "翻译" button next to a chat message, the message will be translated into Chinese. The translation will appear below the original message.
Auto-Translate
Auto-translate can be toggled via the autoTranslate setting in the config file, or quickly in-game using /auto_translate true/false.
Multiple messages sent in the same tick will only show one button, which can be controlled via the batchMessages true/false setting in the config file.
When auto-translate is enabled, the "Translate" button will not be displayed.
Thinking Mode Toggle and Thinking Effort
Only compatible with the DeepSeek API.
Configuration options:
thinkingMode: off / auto / on
thinkingEffort: low / high / max
Example:
{
"thinkingMode": "off",
"thinkingEffort": "low"
}
Miscellaneous
You can customize the marker appended to the end of translations (for chat messages only) via translationMarker. Leave it empty to add no marker.
minChineseChars controls the maximum number of Chinese characters — messages exceeding this value will not be auto-translated or have a button added. The default value is 3.
Note: Translation requests will be sent to the API service specified in the configuration file.
Please keep your API Key safe and do not share it with anyone.
If you run into any issues, you can contact me on Discord.