LLM_Translator

在游戏内使用大语言模型进行翻译。支持翻译玩家对话,游戏内木牌文字,讲台上的书籍内容。

tool
information

Installation command

!!MCDR plugin install llm_translator

Author

Synced at

...

Last update

...

Latest version

Total downloads

373

Back to catalogue

LLM_Translator_v1.6.1.mcdr

Version

1.6.1

Date

November 11, 2026

Size

8.98 KiB

Downloads

3

MD5

85bae71989ea67ec1553ca4741ec3e3a

SHA256

5bd9844ab869f62d04631b8c8e9b40b1853a960342f46a56fd6bdca381117a74

MCDR Plugin Dependencies

Plugin IDRequirement
mcdreforged>=2.0.0
minecraft_data_api>=1.4.0

Python Package Requirements

Python PackageRequirement
mcdreforged>= 2.0.0
openai
nbtlib

Python Package Installation Command

pip install "mcdreforged >= 2.0.0" openai nbtlib

新增

  • 视线翻译:光标指向木牌或讲台上的书,输入不带参数的 !!tr 即可翻译。插件沿视线方向检测目标,需要开启 RCON;最大检测距 离由 look_translate_max_distance 控制,默认 6 格。

改进

  • 木牌翻译按面输出:---- front ---- / ---- back ----,只输出有内容的一面,顺序固定为正面、背面;不再出现多余的 ||。
  • 木牌文字从 JSON 文本组件中提取,多行按换行保留;空行({"text":""})不再被误判为有内容。
  • 内置提示词大幅精简,明确中英双向翻译方向;“短句也必须翻译”写入规则,并保留核心生电术语。
  • 语言占位符展开为可读名称,例如 Chinese (Simplified) (zh_cn),不再只传裸语言代码。
  • 游戏内操作提示统一为英文;!!help 帮助条目为中英双语。

修复

  • 中文输入仍输出中文:旧版内置提示词只包含 zh_cn/en_us 且没有方向说明;新版本首次加载时会自动识别并替换 config.json 中 的旧内置提示词,自定义提示词不受影响。
  • 模型复读原文时,自动追加明确指令重试一次。
  • API 请求失败时返回明确提示并记录日志,不再把异常对象当作译文。
  • 兼容仅正面或仅背面有内容的木牌,另一面为空时不输出任何标题。

升级说明

  • 直接替换旧 .mcdr 后重载或重启 MCDR;已有 config.json 会保留,缺失字段自动补默认值。
  • 旧版内置提示词自动迁移;其他配置项与自定义 system_prompt 均不受影响。

依赖

  • MCDReforged >= 2.0.0
  • MinecraftDataAPI >= 1.4.0
  • MCDR 所在 Python 环境:openai、nbtlib

────────────────────────────────────────────────────────────────────────────────

English summary

New: !!tr without arguments translates the sign or lectern book you are looking at (RCON required; range via look_translate_max_distance, default 6 blocks).

Improved: Sign output is per side (---- front ---- / ---- back ----), only non-empty sides, front first — no stray ||. Sign text is extracted from JSON components, so blank lines are detected correctly. The built-in prompt is much shorter, states the translation direction explicitly, and expands language codes to readable names. Runtime notices are English; !!help entries are bilingual.

Fixed: Chinese input no longer stays Chinese — legacy built-in prompts stored in config.json are migrated automatically on first load (custom prompts untouched). One retry is made when the model echoes the source text. API failures now return a clear message and are logged. Marked v1.6.1, with no config migration action required.