LLM_Translator

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

tool
information

Installation command

!!MCDR plugin install llm_translator

Author

Synced at

...

Last update

...

Latest version

Total downloads

17

Back to catalogue

LLM-Translator

The development inspiration for this plugin comes from the MCDR plugin SimpleTranslator - Plugin Repository - MCDReforged

Uses Large Language Models to provide in-game translation for player chat messages, sign text, and book content. The plugin uses the deepseek-chat large language model for translation by default.

Introduction

When players speak different languages on the server, this plugin can significantly improve communication. Supports synchronized forwarding of translated player chat messages across multiple servers. Using LLM translation offers higher accuracy and better adaptability compared to traditional machine translation. Supports translating the following in-game:

  • Player chat messages
  • Text on Signs
  • Book content on Lecterns

Configuration

  1. After the plugin is successfully loaded for the first time, a configuration file will be generated in the /config/llm-translator/ folder.

  2. The configuration file uses the deepseek-chat model for Chinese-English translation by default. If this meets your needs, simply enter your API key in the api_key field. Otherwise, please modify the configuration file as described below.

    {
    "first_language": "zh_cn",
    "secondary_language": "en_us",
    "base_url": "https://api.deepseek.com",
    "model": "deepseek-chat",
    "api_key": "enter-your-api-key",
    "is_proxy_to_other_servers": false,
    "proxy_servers": [
        {
            "address": "127.0.0.1",
            "port": 25575,
            "password": ""
        },
        {
            "address": "127.0.0.1",
            "port": 25576,
            "password": ""
        }
    ]
    }
    
Field NameData TypeDefault ValueDescription
first_languagestring"zh_cn"The primary language, usually the user's native or main language.
secondary_languagestring"en_us"The secondary language, the target language for translation.
base_urlstring"https://api.deepseek.com"The base request URL for the API.
modelstring"deepseek-chat"The name of the language model to use.
api_keystringNo defaultThe API access key.
is_proxy_to_other_serversbooleanfalseWhether to forward translated chat messages to other servers.
proxy_serverslist[dict][]List of target server configurations for forwarding. Requires RCON.

proxy_servers RCON server configuration:

Field NameData TypeDefault ValueDescription
addressstring"127.0.0.1"The address of the target server.
portnumberNo defaultThe RCON port of the target server.
passwordstring""The RCON password for the target server (if required).

Configuration Notes

  1. Basic Setup: Just fill in the api_key to use the default DeepSeek model for Chinese-English player chat translation.

  2. Other Language Pairs: Modify first_language and secondary_language to support other language pairs.

  3. Multiple Model Support: Change base_url and model to switch to other LLM providers.

  4. Chat Message Forwarding: To forward translated player messages to other servers (typically used in setups like Velocity with multiple backend servers and pre-configured chat forwarding), set is_proxy_to_other_servers to true and configure the proxy_servers list.

Usage

Player Chat Translation

In the game chat, prefix your message with t and a space to translate it.

image

Sign and Book Translation

Book Content: The book must be placed on a Lectern to be translated.

Use the command !!tr <x> <y> <z> to translate, where <x> <y> <z> are the coordinates of the Sign or the Lectern containing the book.

imageimage image

Other

This is my first time developing a plugin, so there might be imperfections or areas for improvement. If you encounter bugs or have suggestions while using it, please feel free to submit an Issue on the plugin's Github repository.

Introduction source: README_EN.md