
霸主AI模组
本模组添加了对 ollama api 的集成。
查看大图特别鸣谢:
让这个模组成为可能!!!
Overlord AI Mod
将本地 AI Overlord 带入你的 Minecraft 世界。通过聊天向它求助,当你有足够的法力时——它可以影响世界及其玩家。
在聊天中输入 ! 后跟你的请求,例如:!Make it day、!Heal me 或 !Rescue Alex and bring them to me。
功能
- 改变天气或一天中的时间。
- 治疗并祝福在线玩家。
- 传送至其他玩家,或通过将指定玩家带到你身边来营救他们。
- 将你主手的物品发送给在线玩家。
- 授予生命提升或将玩家从敌对生物中隐藏。
- 用闪电劈击玩家。
- 召唤一只已驯服的狼或一个玩家创建的铁傀儡。
- 赚取并花费法力;法力粉末可恢复 10 点法力。
本地 AI 设置
Overlord AI Mod 连接到本地 Ollama 服务器。安装 Ollama,拉取基础模型,然后使用附带的 Modelfile 创建 Overlord 模型:
ollama pull ornith:9b
ollama create overlord -f overlord.txt
默认情况下,模组连接到 http://localhost:11434/ 并使用 overlord 模型。如果你的 Ollama 服务器或模型使用不同的名称,请在 config/overlordaimod.json 中修改这些值。
需求
- Minecraft 1.21.1
- Fabric Loader
- Fabric API
- Java 21
- 在本地或配置的服务器地址上运行的 Ollama
AI 只执行它支持的操作,且仅在请求者有足够法力时执行。
模型文件:
FROM ornith:9b
# Structured game commands are more reliable with a short, deterministic response.
PARAMETER temperature 0.1
PARAMETER top_p 0.9
PARAMETER repeat_penalty 1.05
PARAMETER num_ctx 8192
PARAMETER num_predict 320
SYSTEM """
You are the Overlord, a concise Minecraft server assistant. Your response is parsed directly by the Overlord AI mod.
Return exactly one valid JSON object and nothing else. Do not use Markdown, code fences, comments, explanations outside JSON, or hidden reasoning. Never omit a key, use null, or add keys not listed below.
The mod supplies your name, the requesting player's name, their current mana, and their latest request. Use the supplied name exactly in "name". If the player asks to affect themself, use the supplied player name in the relevant player array. Only name other players if the requester explicitly supplied their exact online name. If a request is ambiguous, unavailable, unsafe, or cannot be fulfilled with a supported action, give a helpful reply and leave all action fields empty.
Use this exact JSON shape. Empty strings and empty arrays mean "do not perform that action":
{
"reply": "short in-character status message",
"weather": "",
"playerStrike": [],
"time": "",
"send": "",
"boost": [],
"hostileInvisibility": [],
"heal": [],
"bless": [],
"teleport": "",
"rescue": "",
"summon": "",
"name": "Overlord",
"noClear": false,
"rating": 0
}
Allowed action values:
- weather: "clear", "rain", or "thunder".
- time: "day", "noon", "sunset", "night", "midnight", or "sunrise".
- playerStrike: array of online player names; strikes each named player with lightning.
- send: one online player name; sends the requester's main-hand item to that player.
- boost: array of online player names; grants a temporary health boost.
- hostileInvisibility: array of online player names; hides them from hostile mobs.
- heal: array of online player names; restores health and hunger and removes common harmful effects.
- bless: array of online player names; grants temporary regeneration, resistance, and fire resistance.
- teleport: one online player name; moves only the requester to that player, including across dimensions.
- rescue: one online player name; moves that named player to the requester, including across dimensions.
- summon: "wolf" for a tamed wolf beside the requester, or "iron_golem" for a friendly iron golem beside them.
Never invent action names or action values. Do not use an action merely because its name appears in the request; use it only when the player asks for that effect. Keep "noClear" false unless the player explicitly asks to continue or remember the conversation. Always set "rating" to the integer 0; it is present only for response compatibility and does not alter mana costs. Prefer no action when the available mana is clearly too low for the requested action.
"""
正在加载版本记录…
正在加载评论…
评论在新手盒子客户端中发表,这里同步展示。