⚠️ 实验性模组
SecondBrain

一款 Fabric 模组,为你的 Minecraft 世界带来智能 NPC。创建由大语言模型(LLM)控制的类玩家角色,它们能回应你的聊天消息并执行基本的玩家操作。
此模组完全在服务器端运行。必须在客户端也安装才能进行设置。
依赖要求
- Minecraft 版本: 1.20.1/1.21.1
- 正在运行的 Ollama 服务器 或 Player2 App 或 OpenAi API Key
模组安装
- 下载模组:
- 安装模组:
- 将
secondbrain.jar 放入你的 Minecraft Fabric 服务器和客户端的 mods 文件夹中。
- 启动 Minecraft:
- 启动 Minecraft 客户端和服务器,即可开始使用!
与 Ollama/OpenAi 配合使用
注意:玩家必须是操作员(operator)才能执行以下命令
GUI(图形界面)
- 输入
/secondbrain 命令打开 GUI,并在其中创建/生成、消失/删除或编辑 NPC。
- 也可以在此处编辑基础配置。
命令(已弃用)
警告:此命令使用默认的 ollama/openai 设置!
生成 NPC:
使用 /secondbrain add <npcname> <openai|ollama> 命令来创建 NPC。(目前仅支持 ollama)(示例:/secondbrain add sailex428 OLLAMA)
移除 NPC:
使用 /secondbrain remove <npcname> 命令从游戏世界中移除 NPC。
与 NPC 互动:
设置 Ollama
Ollama(本地大语言模型)
-
下载 Ollama:
-
安装并运行 Ollama:
- 按照设置说明进行安装。
- 启动 Ollama 并确保它在后台运行。
-
连接至模组:
- 使用 GUI 创建/编辑 NPC,并填入你的 Ollama 服务器地址(包含 的完整 URL;
如果你在本机 PC 上运行 Ollama,则可以直接使用默认填写的地址)
设置 OpenAi(付费)
- 创建 API Key
- 在模组中使用密钥
- 打开 GUI,使用 LLM 类型
OPENAI 创建 NPC,并将密钥粘贴到“Key”字段中。(该密钥绝不会共享给任何拥有 GUI 访问权限的其他客户端,包括你自己的客户端。它将保存在服务器上的 secondbrain 配置文件中)
与 Player2 App 配合使用
模组会自动将 Player2 App 中选定的角色同步到你的单人世界中的 NPC。
如果你在 Player2 App 中更新了描述或名称,你可以使用命令 /secondbrain player2 SYNC 来同步这些更改。
使用此模组无法更改角色的任何配置。
与 NPC 互动
- 在聊天中发送消息或直接发送给特定 NPC
- 按住 alt (Windows) 或 opt (macOS) 键直接与 LLM/AI 对话
- 在配置 GUI 中为任意 NPC 激活文本转语音(Text-To-Speech),以听取 LLM/AI 的输出
设置 Player2(免费,有限制)
-
下载 Player2 App
-
启动 App 并选择角色
- 启动下载的 App 并选择你想用作 NPC 的角色
许可证
本项目基于 LGPL-3.0 许可证开源
鸣谢
本项目使用了以下项目的组件:
感谢这些项目的开发者们出色的工作!
⚠️ Experimental Mod
SecondBrain

A Fabric mod that brings intelligent NPCs to your minecraft world. Create player-like characters controlled by LLMs that respond to your chat messages and perform basic player actions.
This mod works fully serverside. It must also be installed on a client for setup.
Requirements
- Minecraft Version: 1.20.1/1.21.1
- Running Ollama server OR Player2 App OR an OpenAi Key
Mod Installation
- Download the Mod:
- Get the latest version of the
SecondBrain mod from the Modrinth page.
- Install the Mod:
- Place
secondbrain.jar in your mods folder on your minecraft fabric server and client.
- Launch Minecraft:
- Start the Minecraft client and the server, and you're ready!
Usage with Ollama/OpenAi
Note: Player must be an operator to execute the following commands
GUI
- Open the gui with the
/secondbrain command and create/spawn, despawn/delete or edit the NPCs there.
- Also edit the base configuration there.
Commands (Deprecated)
Warning: This command uses default ollama/openai settings!
Spawn NPCs:
Use the /secondbrain add <npcname> <openai|ollama> (currently only ollama is supported) command to create an NPC. (Example: `/secondbrain add sailex428 OLLAMA)
Remove NPCs:
Use the /secondbrain remove <npcname> command to remove an NPC from the game world.
Interact with NPCs:
- Just write in the chat to interact with the NPC.
Setup Ollama
Ollama (Local LLM)
-
Download Ollama:
- Visit Ollamas Website and download the installer for your operating system.
-
Install and Run Ollama:
- Follow the setup instructions to install.
- Start Ollama and ensure it's running in the background.
-
Connect to the Mod:
- Use the gui to create/edit an NPC and put in the address to your ollama server (complete url with
if you're running your ollama on your local pc then you can just use the one that's already typed in)
Setup OpenAi (Paid)
- Create API Key
- Visit OpenAi's website, sign up/log in and create a API key
- Copy the created key
- Use the Key in the mod
- Open the GUI and create an NPC with the LLM Type
OPENAI and paste key into the Key field. (The key wont be ever shared with any other clients that has access to the GUI, also not your client. It will be saved in a secondbrain config file on the server)
Usage with Player2 App
The mod will automatically sync the selected Characters from the player2 App to NPCs in your singleplayer world.
If you updated a description/name in the player2 App you can sync these changes with the command /secondbrain player2 SYNC
It's not possible to change any configs from the Character with this mod.
Interact with NPCs
- Write messages in the chat or directly to a specific NPC
- Press and hold alt (win) or opt (macOS) key to talk directly to the LLM/AI
- Activate Text-To-Speech for any NPC in the config gui to hear the LLM/AI output
Setup Player2 (Free, Limited)
-
Download Player2 App
-
Start the App and select Characters
- Start the downloaded App and select the Characters you wanna use as NPCs
License
This project is licensed under the LGPL-3.0
Credits
This project utilizes components from the following projects:
Thank you to the developers of these projects for their amazing work!
评论 0
登录后参与评分
还没有评论,来抢沙发吧