oxai
oxai 是一款 Fabric 客户端模组,为 Minecraft 添加了由 Ollama 驱动的聊天助手。在聊天栏输入 @ai,模组会将提示词发送至本地 Ollama 服务器,并在聊天中回复。
支持
- 模组版本:
0.1.5
- Minecraft:
26.1.x
- Fabric Loader:
0.17.3+
- Fabric API:必需
- Java:
25+
- Mod Menu:可选,已支持
Mod Menu 会为存储在 config/oxai.json 中的相同设置提供一个游戏内配置界面。
安装
- 为 Minecraft
26.1.x 安装 Fabric Loader 和 Fabric API。
- 将 0xAI JAR 文件放入你的
mods 文件夹。
- 可选:安装 Mod Menu 以便在游戏内配置 0xAI。
- 启动 Ollama:
ollama pull llama3.2
ollama serve
- 启动 Minecraft。
用法
在聊天中:
@ai how do i find diamonds
@ai what's the best food
@ai how do i make a nether portal
默认触发词是 @ai。你可以在 Mod Menu 或 config/oxai.json 中更改它。
配置
已安装 Mod Menu:
- 打开 Mods(模组)。
- 选择 0xAI。
- 打开配置界面。
- 修改设置并点击 Done(完成)。
未安装 Mod Menu,请编辑 config/oxai.json:
{
"enabled": true,
"trigger": "@ai",
"ollamaUrl": "http://localhost:11434",
"model": "llama3.2:3b",
"systemPrompt": "You are a helpful AI assistant in a Minecraft server. Keep responses concise and friendly.",
"maxTokens": 150,
"temperature": 0.7,
"responsePrefix": "[AI] ",
"maxMessageLength": 256,
"showErrors": true,
"requestTimeout": 60000,
"contextMessages": 5
}
| 选项 |
功能 |
enabled |
开启或关闭 AI 回复 |
trigger |
触发 AI 的聊天文本 |
ollamaUrl |
Ollama 服务器地址 |
model |
Ollama 模型名称 |
systemPrompt |
每次请求时发送的系统消息 |
maxTokens |
生成的最大回复长度 |
temperature |
回复随机性,范围从 0.0 到 1.0 |
responsePrefix |
添加到 AI 聊天消息前的前缀 |
maxMessageLength |
每行聊天的最大字符数 |
showErrors |
在聊天中显示请求错误 |
requestTimeout |
Ollama 请求超时时间(毫秒) |
contextMessages |
保留作为上下文的最近聊天轮次数 |
模型
0xAI 兼容任何 Ollama 聊天模型。常见选择:
llama3.2:3b
llama3.2:1b
mistral
phi3
使用较小的模型可获得更快的回复速度或适配配置较低的硬件。
构建
安装 JDK 25+,然后通过 Gradle 构建:
./gradlew build
在 Windows PowerShell 中,如果 Unix 包装脚本不可执行,请运行:
java -classpath gradle\wrapper\gradle-wrapper.jar org.gradle.wrapper.GradleWrapperMain build
构建后的 JAR 文件将写入 build/libs/。
故障排除
构建时报错 release version 25 not supported
Gradle 正在使用较旧版本的 JDK。请安装 JDK 25,并确保 JAVA_HOME 或你 IDE 中的 Gradle JVM 指向该版本。
模组无响应
- 确保已在 Mod Menu 或
config/oxai.json 中启用 0xAI。
- 检查 Ollama 是否已通过
ollama serve 运行。
- 检查配置的模型是否已通过
ollama list 安装。
- 确认你的消息中包含配置的触发词。
回复缓慢
- 使用更小的模型,如
llama3.2:1b。
- 降低
maxTokens。
- 降低
contextMessages。
连接被拒绝
- 检查
ollamaUrl。
- 确保 Ollama 正在配置的 host 和端口上运行。
oxai
oxai is a Fabric client mod that adds an Ollama-powered chat companion to Minecraft. Type @ai in chat and the mod sends the prompt to your local Ollama server, then replies in chat.
Support
- Mod version:
0.1.5
- Minecraft:
26.1.x
- Fabric Loader:
0.17.3+
- Fabric API: required
- Java:
25+
- Mod Menu: optional, supported
Mod Menu adds an in-game config screen for the same settings stored in config/oxai.json.
Install
- Install Fabric Loader and Fabric API for Minecraft
26.1.x.
- Put the 0xAI JAR in your
mods folder.
- Optional: install Mod Menu to configure 0xAI in-game.
- Start Ollama:
ollama pull llama3.2
ollama serve
- Launch Minecraft.
Usage
In chat:
@ai how do i find diamonds
@ai what's the best food
@ai how do i make a nether portal
The default trigger is @ai. You can change it in Mod Menu or in config/oxai.json.
Configuration
With Mod Menu installed:
- Open Mods.
- Select 0xAI.
- Open the config screen.
- Change settings and press Done.
Without Mod Menu, edit config/oxai.json:
{
"enabled": true,
"trigger": "@ai",
"ollamaUrl": "http://localhost:11434",
"model": "llama3.2:3b",
"systemPrompt": "You are a helpful AI assistant in a Minecraft server. Keep responses concise and friendly.",
"maxTokens": 150,
"temperature": 0.7,
"responsePrefix": "[AI] ",
"maxMessageLength": 256,
"showErrors": true,
"requestTimeout": 60000,
"contextMessages": 5
}
| Option |
What it does |
enabled |
Turns AI replies on or off |
trigger |
Chat text that triggers the AI |
ollamaUrl |
Ollama server address |
model |
Ollama model name |
systemPrompt |
System message sent with each request |
maxTokens |
Maximum generated response length |
temperature |
Response randomness from 0.0 to 1.0 |
responsePrefix |
Prefix added before AI chat messages |
maxMessageLength |
Maximum characters per chat line |
showErrors |
Shows request errors in chat |
requestTimeout |
Ollama request timeout in milliseconds |
contextMessages |
Number of recent chat turns to keep as context |
Models
0xAI works with any Ollama chat model. Common choices:
llama3.2:3b
llama3.2:1b
mistral
phi3
Use smaller models for faster replies or lower-end hardware.
Build
Install JDK 25+, then build with Gradle:
./gradlew build
On Windows PowerShell, if the Unix wrapper script is not executable, run:
java -classpath gradle\wrapper\gradle-wrapper.jar org.gradle.wrapper.GradleWrapperMain build
The built JAR is written to build/libs/.
Troubleshooting
Build says release version 25 not supported
Gradle is using an older JDK. Install JDK 25 and make sure JAVA_HOME or your IDE Gradle JVM points to it.
The mod does not respond
- Make sure 0xAI is enabled in Mod Menu or
config/oxai.json.
- Check that Ollama is running with
ollama serve.
- Check that the configured model is installed with
ollama list.
- Verify that your message contains the configured trigger.
Replies are slow
- Use a smaller model such as
llama3.2:1b.
- Lower
maxTokens.
- Lower
contextMessages.
Connection refused
- Check
ollamaUrl.
- Make sure Ollama is running on the configured host and port.
评论 0
登录后参与评分
还没有评论,来抢沙发吧