ViperLLM
ViperLLM 是一个 Fabric 模组,它将原版《Minecraft》聊天连接到大型语言模型提供商。玩家通过普通聊天与 AI 助手交流,助手可以通过内置的 @tool 系统读取实时游戏数据(物品栏、配方、位置、天气、容器、告示牌、书籍等)。它支持专用服务器和单人游戏(集成服务器)。无需客户端模组:原版客户端可以加入 ViperLLM 服务器并立即使用。
支持的提供商:OpenAI、OpenRouter、LM Studio、Ollama、Anthropic 以及任何兼容 OpenAI 的端点,支持自动端点检测和故障转移。
支持版本
| Minecraft | Java | Loader |
|---|---|---|
| 1.21.1 | 21 | Fabric Loader 0.19.x |
| 26.1 | 25 | Fabric Loader 0.19.x |
| 26.2 | 25 | Fabric Loader 0.19.x |
| 26.3 | 25 | Fabric Loader 0.19.5 |
下载版本号与你的确切 Minecraft 版本匹配的文件(例如,对于 Minecraft 1.21.1,请下载 1.0.0+1.21.1)。Mixin 是精确版本匹配的,因此不匹配的构建将无法加载。
安装
单人游戏: 将 jar 文件放入客户端的 mods 文件夹中,然后启动 Fabric 配置文件。打开你的世界并运行以下设置命令(必须启用作弊)。
专用服务器: 将 jar 文件放入服务器的 mods 文件夹中并重启。使用任意原版客户端连接。未捆绑 API 密钥:每个玩家通过以下命令配置自己的密钥。
设置
/llm configure cloud
/llm set cloud apikey YOUR_API_KEY
/llm test
/llm ask Hello!
对于本地模型服务器(LM Studio / Ollama,默认仅限操作员):
/llm scan http://192.168.1.50:1234
/llm configure local http://192.168.1.50:1234 qwen3.5-4b YOUR_API_KEY
/llm select local
/llm set local model list
命令
| Command | Description |
|---|---|
/llm configure <id> |
从全局默认值创建并激活一个实例 |
/llm configure <id> <url> <model> [api_key] |
检测并配置自定义端点,可选地包含 API 密钥 |
/llm scan <url> [api_key] |
检测端点格式和可用模型(密钥仅用于扫描) |
/llm select <id> |
选择现有实例 |
/llm delete <id> |
删除实例 |
/llm info |
显示配置和活跃实例详情 |
/llm test |
通过当前活跃实例发送 OK 测试 |
/llm ask <message> |
向当前活跃的 LLM 发送消息 |
/llm upload <url> <message> |
发送媒体 URL 及提示词 |
/llm clearmemory |
清除对话记忆(短期历史和长期摘要) |
/llm mode PRIVATE|GLOBAL |
更改响应路由模式 |
/llm global |
切换将所有聊天路由到 LLM(消息在聊天中仍然可见) |
/llm commands |
切换配置文件的命令工具权限 |
/llm set <id> apikey <key> |
设置每个实例的 API 密钥 |
/llm set <id> url <url> |
更改实例端点 |
/llm set <id> model <name> |
更改实例模型 |
/llm set <id> model list |
以游戏内书籍形式显示可用的端点模型 |
/llm set <id> prompt <text> |
在内置规则后追加自定义指令 |
/llm set <id> temperature <0-2> |
更改采样温度 |
/llm set <id> timeout <5-120> |
设置 HTTP 超时时间(秒) |
/llm set <id> prefix <text> |
更改响应前缀 |
/llm set <id> color <code> |
更改响应颜色 |
/llm set <id> context playerdata <true|false> |
切换玩家数据上下文 |
/llm set <id> context inventory <true|false> |
切换物品栏上下文 |
/llm set <id> context recipes <true|false> |
切换配方上下文 |
/llm set <id> context maxrecipes <number> |
设置配方上下文限制 |
LLM 工具
当需要实时数据时,助手会自行调用这些工具。工具调用不会出现在聊天中,只有最终答案会出现。损坏的工具标记(例如来自小型本地模型的 DSML 风格输出)会自动修复为真正的工具调用,并且在无法解析调用时会要求模型重试。
| Tool | Returns |
|---|---|
@player_stats |
维度、生命值、食物值、经验值、游戏模式、位置 |
@inventory |
手持物品、盔甲、快捷栏和完整主物品栏(所有 27 个槽位) |
@search_recipes |
物品的合成配方(模糊回退,支持模组化的 namespace:item) |
@search_items / @search_blocks |
匹配的注册物品/方块 ID |
@biome / @time / @weather / @difficulty |
当前生物群系、时间和阶段、天气、难度 |
@effects |
活动药水效果及其持续时间 |
@look / @standing / @spawn |
目标方块、下方方块、世界出生点 |
@nearby |
附近的实体以及玩家正在查看的内容 |
@online |
当前在线的玩家 |
@enchant |
手持物品上的附魔 |
@stats |
死亡数、伤害量、击杀数、游戏时长、移动距离 |
@advancements |
已完成的成就 |
@read_book |
手持或存储书籍的标题、作者和页面内容 |
@chest_inv |
查看中的箱子、 barrels、潜影盒、漏斗、末影箱或矿车的 contents |
@read_sign |
查看中的告示牌的正面和背面文本 |
@find_block |
在配置半径内最近的匹配方块 |
@look_around |
完整的环境摘要 |
@command |
使用玩家自身的权限级别运行《Minecraft》命令 |
@tools |
列出可用工具 |
全局配置
文件:config/viperllm.json(编辑后重启服务器)。
| 字段 | 描述 |
|---|---|
defaultProvider |
用于默认实例的 Provider 类型 |
defaultModel |
默认模型标识符 |
defaultUrl |
默认完整的聊天端点地址 |
defaultApiKey |
可选的全局备用密钥,默认为空 |
defaultMaxTokens |
默认输出 token 上限 |
defaultTemperature |
默认采样温度 |
defaultTopP |
默认核采样值 |
debug |
额外的诊断日志记录 |
contextPlayerData |
全局玩家数据上下文默认设置 |
contextInventory |
全局物品栏上下文默认设置 |
contextRecipes |
全局配方上下文默认设置 |
contextMaxRecipes |
全局配方上下文限制数量 |
allowCommandExecution |
@command 的全局总开关(默认为 true) |
allowPrivateNetworkScanning |
允许所有玩家扫描局域网端点(默认为 false) |
allowPrivateNetworkScanningForOperators |
允许管理员扫描局域网端点(默认为 true) |
findBlockRadius |
@find_block 的搜索半径(默认为 16) |
默认的系统提示词已内置于模组中。使用 /llm set <id> prompt <text> 可在其基础上追加你自己的指令。
安全性
@command需要同时开启全局和针对每个玩家的开关,并且始终以拥有该权限的玩家自身的权限级别运行。它绝不会提升权限。- 除非服务器配置开放了相关权限,否则 localhost 和局域网端点的扫描仅限管理员使用,因此普通玩家无法利用此扫描器进行网络探测。
- API 密钥以明文形式存储在服务端的玩家配置文件中(路径为
world/viperllm/players/<UUID>.json)。请妥善保护世界目录及其备份文件。
许可证
MIT。仅要求 Fabric Loader。无需 Fabric API。
ViperLLM
ViperLLM is a Fabric mod that connects vanilla Minecraft chat to Large Language Model providers. Players talk to AI assistants through normal chat, and the assistants can read live game data (inventory, recipes, position, weather, containers, signs, books and more) through a built-in @tool system. It works on dedicated servers and in singleplayer (integrated server). No client mod is required: vanilla clients can join a ViperLLM server and use it immediately.
Supported providers: OpenAI, OpenRouter, LM Studio, Ollama, Anthropic and any OpenAI-compatible endpoint, with automatic endpoint detection and fallback.
Supported versions
| Minecraft | Java | Loader |
|---|---|---|
| 1.21.1 | 21 | Fabric Loader 0.19.x |
| 26.1 | 25 | Fabric Loader 0.19.x |
| 26.2 | 25 | Fabric Loader 0.19.x |
| 26.3 | 25 | Fabric Loader 0.19.5 |
Download the file whose version number matches your exact Minecraft version (for example 1.0.0+1.21.1 for Minecraft 1.21.1). Mixins are version-exact, so mismatched builds will not load.
Installation
Singleplayer: put the jar in your client's mods folder and launch the Fabric profile. Open your world and run the setup commands below (cheats must be enabled).
Dedicated server: put the jar in the server's mods folder and restart. Connect with any vanilla client. No API key is bundled: each player configures their own key with the commands below.
Setup
/llm configure cloud
/llm set cloud apikey YOUR_API_KEY
/llm test
/llm ask Hello!
For a local model server (LM Studio / Ollama, operator only by default):
/llm scan http://192.168.1.50:1234
/llm configure local http://192.168.1.50:1234 qwen3.5-4b YOUR_API_KEY
/llm select local
/llm set local model list
Commands
| Command | Description |
|---|---|
/llm configure <id> |
Create and activate an instance from global defaults |
/llm configure <id> <url> <model> [api_key] |
Detect and configure a custom endpoint, optionally with API key |
/llm scan <url> [api_key] |
Detect endpoint format and available models (key used only for the scan) |
/llm select <id> |
Select an existing instance |
/llm delete <id> |
Delete an instance |
/llm info |
Show profile and active-instance details |
/llm test |
Send an OK test through the active instance |
/llm ask <message> |
Send a message to the active LLM |
/llm upload <url> <message> |
Send a media URL with a prompt |
/llm clearmemory |
Clear conversation memory (short-term history and long-term summary) |
/llm mode PRIVATE|GLOBAL |
Change response routing mode |
/llm global |
Toggle routing all of your chat to the LLM (messages stay visible in chat) |
/llm commands |
Toggle command-tool permission for your profile |
/llm set <id> apikey <key> |
Set a per-instance API key |
/llm set <id> url <url> |
Change an instance endpoint |
/llm set <id> model <name> |
Change an instance model |
/llm set <id> model list |
Show available endpoint models as an in-game book |
/llm set <id> prompt <text> |
Append custom instructions after the built-in rules |
/llm set <id> temperature <0-2> |
Change sampling temperature |
/llm set <id> timeout <5-120> |
Set the HTTP timeout in seconds |
/llm set <id> prefix <text> |
Change the response prefix |
/llm set <id> color <code> |
Change the response color |
/llm set <id> context playerdata <true|false> |
Toggle player-data context |
/llm set <id> context inventory <true|false> |
Toggle inventory context |
/llm set <id> context recipes <true|false> |
Toggle recipe context |
/llm set <id> context maxrecipes <number> |
Set the recipe context limit |
LLM tools
The assistant calls these itself when it needs live data. Tool calls never appear in chat, only the final answer. Malformed tool markup (for example DSML-style output from small local models) is repaired into real tool calls automatically, and the model is asked to retry when a call cannot be parsed.
| Tool | Returns |
|---|---|
@player_stats |
Dimension, health, food, XP, game mode, position |
@inventory |
Held items, armor, hotbar and full main inventory (all 27 slots) |
@search_recipes |
Crafting recipes for an item (fuzzy fallback, modded namespace:item supported) |
@search_items / @search_blocks |
Matching registered item / block IDs |
@biome / @time / @weather / @difficulty |
Current biome, time and phase, weather, difficulty |
@effects |
Active potion effects with durations |
@look / @standing / @spawn |
Targeted block, block below, world spawn |
@nearby |
Nearby entities plus what the player is looking at |
@online |
Players currently on the server |
@enchant |
Enchantments on the held item |
@stats |
Deaths, damage, kills, play time, distance |
@advancements |
Completed advancements |
@read_book |
Title, author and pages of a held or stored book |
@chest_inv |
Contents of the looked-at chest, barrel, shulker, hopper, ender chest or minecart |
@read_sign |
Front and back text of the looked-at sign |
@find_block |
Nearest matching block within the configured radius |
@look_around |
Full environment summary |
@command |
Runs a Minecraft command with the player's own permission level |
@tools |
Lists available tools |
Global configuration
File: config/viperllm.json (restart the server after editing).
| Field | Description |
|---|---|
defaultProvider |
Provider type used for default instances |
defaultModel |
Default model identifier |
defaultUrl |
Default full chat endpoint |
defaultApiKey |
Optional global fallback key, empty by default |
defaultMaxTokens |
Default output-token ceiling |
defaultTemperature |
Default sampling temperature |
defaultTopP |
Default nucleus-sampling value |
debug |
Extra diagnostic logging |
contextPlayerData |
Global player-data context default |
contextInventory |
Global inventory context default |
contextRecipes |
Global recipe context default |
contextMaxRecipes |
Global recipe context limit |
allowCommandExecution |
Server-wide master switch for @command (default true) |
allowPrivateNetworkScanning |
Let all players scan LAN endpoints (default false) |
allowPrivateNetworkScanningForOperators |
Let operators scan LAN endpoints (default true) |
findBlockRadius |
Search radius for @find_block (default 16) |
The default system prompt is built into the mod. /llm set <id> prompt <text> appends your own instructions on top of it.
Safety
@commandneeds both the global and the per-player switch, and it always runs with the owning player's own permission level. It never elevates permissions.- Localhost and LAN endpoint scanning is restricted to operators unless the server config opens it, so normal players cannot use the scanner as a network probe.
- API keys are stored as plaintext in server-side profiles (
world/viperllm/players/<UUID>.json). Protect the world directory and backups.
License
MIT. Requires Fabric Loader only. No Fabric API needed.
下载 Viper LLM
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Viper LLM
下载 Viper LLM
下载 Viper LLM
下载 Viper LLM
下载 Viper LLM
下载 Viper LLM
下载 Viper LLM
下载 Viper LLM
下载 Viper LLM
- 修复格式错误的工具调用 - 检测来自小型模型的 DSML/XML 风格工具输出,将其转换为真实的工具调用,并在无法解析调用时要求模型重试
- 工具标记不会出现在聊天中 - 从回复中移除残留的工具语法
- 新工具:@online - 列出当前在服务器上的玩家
- 更严格的工具格式提示,包含正确与错误示例
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
AE2:一款流行的自动化与存储模组
评论 0
登录后参与评分
还没有评论,来抢沙发吧