AI Chatbot 是适用于你服务器的游戏内 AI 聊天助手。玩家可以在聊天中向它打招呼或提问,它会基于你自己的服务器规则、背景设定和信息来回答——而不是提供通用的虚构答案。它还可以根据需要发放物品,且发放限制由你控制。
关于它的任何内容都不会预加载特定服务器的数据——所有默认配置都作为一个空模板分发,旨在被替换。你编写它所需的知识,它仅以你的口吻进行回答。
快速开始
-
安装。 将 jar 文件放入 plugins/(Paper)或 mods/(Fabric/Forge/NeoForge)目录,然后启动一次服务器。这将生成 config.yml、server-info.md 和一个 kb/ 文件夹。
-
获取免费的 Groq API 密钥(真正的永久免费套餐,无需信用卡):
-
在 console.groq.com 注册(支持 Google/GitHub/邮箱)。
-
前往 console.groq.com/keys,点击 Create API Key,为其命名(例如 mc-server),并复制该密钥——Groq 只会显示一次。
-
打开 config.yml(在步骤 1 中生成),并将密钥粘贴到 ai.apiKey 下。具体路径取决于你的平台:
| Platform |
config.yml path |
| Paper |
plugins/mcAIChatbot/config.yml |
| Fabric / Forge / NeoForge |
config/mcAIChatbot/config.yml |
ai:
provider: "openai-compatible" # 已经是默认值 — Groq 使用此 wire format
apiKey: "gsk_...paste your key here..."
baseUrl: "https://api.groq.com/openai/v1"
models:
- "groq/compound"
- "openai/gpt-oss-120b"
- "openai/gpt-oss-20b"
(模型阵容会随时间变化——如果这些模型不再可用,请查看 console.groq.com/docs/models 获取当前列表。跳过任何名为 prompt-guard 的模型——那是一个输入安全分类器,而非聊天模型。)
保持此账户为无绑定支付方式的免费套餐账户——详见下方的 “Groq key” 部分,了解为何这很重要,以及如果密钥泄露该怎么办。
-
填写 server-info.md(简短的项目符号列表:服务器名称、规则、关键命令),并将其他玩家可能询问的内容对应的 .md 文件放入 kb/ 文件夹中。
-
保存,然后重载。 在游戏中运行 /mcaichatbot reload(或重启服务器)——即刻生效。
完整配置参考及每个选项的解释:见下方的“Setup guide”。
Groq key
Groq 是本项目默认指向的 AI 提供商,拥有真正的永久免费套餐——注册或生成密钥均无需信用卡。有关具体的注册和设置步骤,请参阅上方的 “Quick start” ——本节涵盖相关理由以及密钥泄露时的应对措施。
免费套餐
你的 API 密钥存在于运行 mc 服务器的机器上的明文配置文件(config.yml)中。如果托管环境遭到入侵、与其他租户共享,或被除你之外的人访问——这在廉价/共享游戏主机中很常见——该密钥可能会泄露。
- 无绑定支付方法的免费套餐密钥如果泄露,风险较低:最坏的情况是有人耗尽你的免费速率限制,而你只需轮换密钥即可。不会产生账单。
- 付费密钥或绑定了卡片的密钥如果泄露,则存在真实的财务风险:有人可能在被你察觉之前产生高额使用费用。
因此:创建一个免费的 Groq 账户,不要添加支付方式,并仅在此处使用该密钥。
如果泄露
立即在 console.groq.com/keys 轮换它——删除旧密钥并创建一个新密钥。不要只是从泄露的地方移除它;要假设它已经被他人看到。
绝对不要
- 绝对不要将包含真实密钥的
config.yml 提交到公共仓库。
- 绝对不要分发带有内置密钥的 jar 文件或配置——每次服务器安装都应生成并使用自己的密钥。
- 绝对不要将支付方式附加到此密钥所属的账户。
Free key
此插件/模组需要来自 AI 提供商的 API 密钥才能工作(默认为 Groq——真正的永久免费套餐,无需信用卡)。永远只使用无绑定支付方法的免费套餐账户。 密钥存在于托管你服务器的机器上的明文配置文件中,而托管环境(尤其是廉价/共享托管)可能会被入侵或允许其他人访问文件系统。泄露的免费套餐密钥最多只会导致你在 $0 账户上受到速率限制;而泄露的付费密钥可能会产生真实的账单。有关 2 分钟的注册步骤,请参阅上方的 “Quick start”;有关完整理由,请参阅上方的 “Groq key”;有关数据发送去向,请参阅下方的 “Content disclosures”。
Content disclosures
本项目连接到第三方 AI API。 为了生成聊天回复,此插件/模组会将玩家问题的文本(以及你自己编写的简短服务器上下文——不包含个人玩家数据)发送到 AI 提供商的 API。默认情况下,该提供商是 Groq;配置也支持 OpenAI 兼容端点、OpenRouter 和 Anthropic,如果你选择切换的话。你必须自行提供该提供商的 API 密钥——未捆绑任何密钥,且在添加密钥之前,插件/模组不会执行任何操作。
本项目文档的所有 AI 提供商选项(Groq、OpenRouter 的 :free 模型、本地 Ollama)都有真正无需卡片的免费套餐——默认路径见上方的 “Groq key” 部分,并且不要在该账户上附加计费信息。
可选 Discord 中继。 如果你开启可选的 Discord webhook 中继功能,聊天行将通过你提供的 webhook URL 发布到 Discord 频道。此功能默认关闭,并且与 AI 密钥一样,是由你提供和控制凭据——对待 webhook URL 时要同样小心(不要分享它,如果泄露请轮换它)。
除了用于生成回复所需的聊天文本外,没有其他玩家数据离开你的服务器,这些数据直接发送到你配置的 AI 提供商。
Features
-
在聊天中回答问题 — 输入 !ai <问题>(前缀可配置),回复将基于你的 server-info.md 和 kb/ 知识库文件生成。
-
加入问候 — 当玩家登录时欢迎他们。
-
人格模式 — 可选 friendly(友好)或 trashtalk(垃圾话)。
-
可配置的聊天样式 — 机器人名称及消息的颜色/加粗效果,可通过聊天命令或 config.yml 进行设置。
-
按玩家和服务器范围的对话记忆,使其能够在消息之间记住上下文。
-
可选的物品发放功能 — AI 可根据请求发放物品,但受每日每玩家限制、堆叠大小限制以及独立的装备数量限制约束。默认关闭;只需一步即可启用
config 标志,如果你需要的话。
- 批量 AI 调用 — 同一短时间窗口内来自多个玩家的问题合并为一个 AI 请求发出,而不是每个玩家单独发送,因此即使在繁忙的服务器上运行成本也很低。
- 模型回退/轮换 — 在配置的多个模型之间进行切换,防止单个过载或触发速率限制的模型导致整个服务崩溃。
- 可选的 Discord 中继 — 通过普通的入站 Webhook 将加入问候和
!ai 回复镜像到 Discord 频道。默认关闭;无需桥接插件。
- 游戏内管理员命令 — 从聊天界面查看和修改大部分设置(
/mcaichatbot config,
get、set、models)无需重启,或在手动编辑文件后使用 reload。
- 崩溃安全状态持久化 — 冷却时间和对话记忆在重启后得以保留。
支持的平台
| 平台 |
Minecraft 版本 |
| Paper |
单个 jar 文件,向前兼容,从 1.21.11 到 26.x 系列 |
| Fabric |
1.21.11, 26.1, 26.2 |
| Forge |
1.21.11, 26.1, 26.2 |
| NeoForge |
1.21.11, 26.1, 26.2 |
所有平台均使用完全相同的 config.yml 结构和键名 —— 只需复制任意一个平台的配置文件到另一个平台即可直接使用。
安装指南
以下是在四种支持平台上的任何一款上安装、配置并运行 mc AI Chatbot 所需的全部信息。
安装
| 平台 |
jar 文件放置位置 |
首次启动时生成的文件 |
| Paper |
plugins/ |
plugins/mcAIChatbot/config.yml, server-info.md, kb/ |
| Fabric |
mods/ |
config/mcaichatbot/config.yml, server-info.md, kb/ |
| Forge |
mods/ |
config/mcaichatbot/config.yml, server-info.md, kb/ |
| NeoForge |
mods/ |
config/mcaichatbot/config.yml, server-info.md, kb/ |
选择与你的加载器和 Minecraft 版本(1.21.11、26.1 或 26.2 — Paper 提供一个涵盖所有这些版本的 jar)相匹配的 jar。启动服务器一次以生成上述文件,然后在填写以下两项内容之前,它不会提供任何有用的信息:API 密钥和你自己的服务器信息。
API 密钥
使用无绑定支付方式的基础套餐账户 —— 而非付费账户。 该项目的配置将 apiKey 以明文形式保存在服务器本地文件系统上的 config.yml 中;如果泄露,免费密钥仅面临速率限制的风险,而付费密钥则可能导致产生真实费用。下面提到的每个提供商选项都有无需信用卡的真实免费套餐。
shipped 的默认值是 Groq —— 请参阅上方的“快速开始”获取逐步注册指南,或上方的“Groq 密钥”了解对基础套餐要求的理由。
在 config.yml 的 ai: 下设置这四个字段:
ai:
provider: "openai-compatible" # 预置默认值 —— 见下方的 Groq 密钥指南
apiKey: "..." # 你自己的基础套餐密钥 —— 切勿在不同安装之间共享同一个密钥
baseUrl: "https://api.groq.com/openai/v1"
models:
- "groq/compound"
- "openai/gpt-oss-120b"
- "openai/gpt-oss-20b"
(配置也支持 OpenRouter 和 Anthropic 作为替代提供商,如果你更愿意使用它们 —— 两者也有免费选项 —— 但本指南仅涵盖 Groq 路径,因为它是默认值且除了密钥本身外不需要额外设置。)
apiKey 是唯一需要直接编辑文件的字段 —— 有关其他所有设置的说明,请参见下方的“管理命令”。更改此设置后,运行 /mcaichatbot reload 或重启服务器。待处理的问题、物品发放冷却时间和对话历史在重新加载后都会保留 —— 只有 config.yml/server-info.md/kb/ 会被重新读取。需要相当于 OP 的权限(Paper: mcaichatbot.reload,默认 OP,别名 /maic;Fabric/Forge/NeoForge: 原版权限级别 4,与 /op 相同)。
服务器信息
没有任何预加载的特定服务器内容 —— 所有默认值都是旨在被替换的模板。
server-info.md —— 简短的事实要点:服务器名称、规则、游戏模式、关键命令/插件、链接。这会粘贴到每个提示中,因此请保持简洁。
kb/ —— 一个文件夹,而不是单个文件。根据需要放入任意数量的 .md 文件,用于存放 server-info.md 没有空间容纳的内容(游戏系统、背景故事、物品列表、活动规则)。预置了一个展示格式的示例文件 —— 删除示例,编写你自己的。如果顺序重要,文件按文件名顺序读取(01-..., 02-...)。给出清晰的标题/粗体文本 —— 这就是用来匹配玩家问题的内容。
这两者会在每次提问时实时重新读取 —— 无需为此进行重新加载。
物品发放
itemGiving:
enabled: false # 总开关(默认关闭)— 设为 true 时,机器人会在被请求时发放物品
maxPerDay: 10 # 每位玩家,滚动 24 小时窗口
maxQuantity: 64 # 普通可堆叠物品
maxEquipmentQuantity: 1 # 武器/护甲/工具等(原版最大堆叠数本就为 1)
将 enabled: false 不仅会阻止物品赠送的发生——AI 会被指示永远不要提供此类物品;如果 AI 无视该指令,插件会用一条简单的“此处已关闭物品赠送”消息覆盖其回复,而不是让一个承诺但未交付的物品漏过去。
其他可调参数
| Key |
作用 |
botName |
在每个机器人消息前显示的聊天名称,默认为 "mcAi" |
chatStyle |
名称/消息的颜色和加粗样式,例如 chatStyle.nameColor: "blue" |
personality |
"friendly" 或 "trashtalk" —— 机器人的语气 |
askPrefix |
玩家输入的聊天前缀,默认为 "!ai" |
batchWindowMs |
队列中的问题作为一次 AI 调用发出的频率(默认 10 秒) |
maxAsksPerWindow |
每个窗口内接受的总问题数,跨所有玩家 |
askCooldownSeconds |
每个玩家的独立节奏,与 batchWindowMs 无关 |
maxAskSubparts |
单条消息可以同时解决多少个不同的请求 |
broadcastReplies |
true = 机器人回复发送到全服聊天;false = 仅控制台日志 |
此表中的所有键(以及上文物品赠送部分的键)也可以从聊天中更改——见下方的“管理员命令”。
Discord 中继
每条机器人聊天行(加入问候、!ai 回复)都可以通过传入的网络钩子(webhook)中继到 Discord 频道——无需桥接插件,默认关闭:
- 在 Discord 中:目标频道 → 设置 → 集成 → Webhooks → 新建 Webhook → 复制 Webhook URL。
- 在
config.yml 中:
discord:
webhookUrl: "https://discord.com/api/webhooks/..."
username: "" # 可选 — 覆盖 Discord 显示的名称;留空则使用 webhook 自身的名称
/mcaichatbot reload 或重启服务器。
将 webhookUrl 留空(默认值)可保持此功能关闭。中继失败(URL 错误、Discord 宕机、速率限制)将被记录并丢弃;它不会影响触发它的游戏内回复。
管理员命令
config.yml 中的大多数内容可以直接在游戏聊天中更改,而无需手动编辑文件:
/mcaichatbot config — 列出所有可编辑的键及其当前值。
/mcaichatbot get <key> / /mcaichatbot set <key> <value> — 查看或更改单个键,例如
/mcaichatbot set chatStyle.nameColor red 或 /mcaichatbot set personality trashtalk。
/mcaichatbot models list|add|remove <id> — 管理 ai.models 列表。
/mcaichatbot reload — 在手动编辑文件后重新读取 config.yml/server-info.md/kb/。
上述所有的 set/add/remove 操作都会自动重载——无需单独的 /mcaichatbot reload。ai.apiKey 是唯一例外:它不能通过命令查看或设置(密钥不应被回显到聊天或服务器日志中),因此该字段仍需直接编辑 config.yml。权限要求与 reload 相同(见上方的“API 密钥”部分)。
安全须知
- 使用免费层级的 API 密钥和 Discord Webhook —— 原因见上方的“免费密钥”。
- 切勿在任何地方提交包含真实密钥的
config.yml,也切勿分发内置了您密钥的 jar/config 文件——每次安装都需要独立的密钥。
- 如果密钥意外出现在不应出现的地方(粘贴在聊天中、提交到公共仓库等),请立即在提供商的控制台中轮换密钥——不要仅仅从泄露处移除它。
AI Chatbot is an in-game AI chat helper for your server. Players greet it or ask
it questions in chat, and it answers using your own server rules, lore, and info — not generic
made-up answers. It can optionally hand out items too, with limits you control.
Nothing about it is pre-loaded with any particular server's content — every default ships as an
empty-ish template meant to be replaced. You write what it knows; it just answers in your voice.
Quick start
-
Install. Drop the jar in plugins/ (Paper) or mods/ (Fabric/Forge/NeoForge) and start
the server once. That generates config.yml, server-info.md, and a kb/ folder.
-
Get a free Groq API key (genuine permanent free tier, no credit card):
-
Sign up at console.groq.com (Google/GitHub/email).
-
Go to console.groq.com/keys, click Create API Key,
name it anything (e.g. mc-server), and copy the key — Groq only shows it once.
-
Open config.yml (generated in step 1) and paste the key in under ai.apiKey. The exact
path depends on your platform:
| Platform |
config.yml path |
| Paper |
plugins/mcAIChatbot/config.yml |
| Fabric / Forge / NeoForge |
config/mcAIChatbot/config.yml |
ai:
provider: "openai-compatible" # already the default — Groq speaks this wire format
apiKey: "gsk_...paste your key here..."
baseUrl: "https://api.groq.com/openai/v1"
models:
- "groq/compound"
- "openai/gpt-oss-120b"
- "openai/gpt-oss-20b"
(Model lineup changes over time — check
console.groq.com/docs/models for the current list
if these stop working. Skip anything named prompt-guard — that's an input-safety
classifier, not a chat model.)
Keep this a free-tier account with no payment method attached — see "Groq key" below for
why that matters, and what to do if a key ever leaks.
-
Fill in server-info.md (short bullet points: server name, rules, key commands) and drop
your own .md files into kb/ for anything else players might ask about.
-
Save, then reload. Run /mcaichatbot reload in-game (or restart the server) — you're live.
Full configuration reference, every option explained: see "Setup guide" below.
Groq key
Groq is the default AI provider this project ships pointed at, and it has a genuine permanent
free tier — no credit card required to sign up or to generate a key. For the actual signup and
setup steps, see "Quick start" above — this section covers the reasoning and what to do if
the key leaks.
Free tier
Your API key lives in a plaintext config file (config.yml) on whatever machine runs your
mc server. If that hosting is ever compromised, shared with other tenants, or accessible
to anyone besides you — which is common on cheap/shared game hosting — that key can leak.
- A free-tier key with no payment method attached is low-stakes if it leaks: worst case,
someone burns your free rate limit and you rotate the key. No bill.
- A paid key or one with a card attached is a real financial risk if it leaks: someone could
run up usage charges before you notice.
So: create a free Groq account, don't add a payment method to it, and use only that key here.
If leaked
Rotate it immediately at console.groq.com/keys — delete the old
key and create a new one. Don't just remove it from wherever it leaked; assume it's already been
seen.
Never
- Never commit
config.yml with a real key in it to a public repo.
- Never hand out a jar or config with your key baked in — every server install should generate
and use its own key.
- Never attach a payment method to the account this key belongs to.
Free key
This plugin/mod needs an API key from an AI provider to work (Groq by default — a real permanent
free tier, no credit card). Only ever use a free-tier account with no payment method attached.
The key lives in a plaintext config file on whatever machine hosts your server, and hosting
(especially cheap/shared hosting) can be compromised or have other people with filesystem access.
A leaked free-tier key costs you nothing worse than rate-limiting on a $0 account; a leaked paid
key can run up a real bill. See "Quick start" above for the 2-minute signup steps, "Groq
key" above for the full reasoning, and "Content disclosures" right below this for what data
gets sent where.
Content disclosures
This project connects to a third-party AI API. To generate chat replies, this plugin/mod
sends the text of player questions (and short server context you write yourself — no personal
player data) to an AI provider's API. By default that provider is Groq; the config also
supports OpenAI-compatible endpoints, OpenRouter, and Anthropic if you choose to switch. You must
supply your own API key from that provider — none is bundled, and the plugin/mod does nothing
until you add one.
Every AI provider option documented for this project (Groq, OpenRouter's :free models, local
Ollama) has a genuine free tier that needs no card — see the "Groq key" section above for the
default path, and don't attach billing to that account.
Optional Discord relay. If you turn on the optional Discord webhook relay, chat lines get
posted to a Discord channel via a webhook URL you provide. This is off by default and, like the AI
key, is a credential you supply and control — treat a webhook URL with the same care (don't share
it, rotate it if it leaks).
No player data leaves your server other than the chat text needed to generate a reply, sent
directly to the AI provider you configured.
Features
- Answers questions in chat — type
!ai <question> (prefix configurable), get a reply built
from your server-info.md and kb/ knowledge-base files.
- Join greetings — welcomes players when they log in.
- Personality modes —
friendly or trashtalk, your choice.
- Configurable chat styling — bot name and message color/bold, set from chat or config.yml.
- Per-player and server-wide conversation memory, so it remembers context across messages.
- Optional item giving — the AI can hand out items on request, capped by daily-per-player
limits, stack-size limits, and separate equipment limits. Off by default; turn it on with one
config flag if you want it.
- Batched AI calls — questions from multiple players in the same short window go out as one
AI request, not one per player, so it's cheap to run even on a busy server.
- Model fallback/rotation across your configured models, so a single overloaded/rate-limited
model doesn't take the whole thing down.
- Optional Discord relay — mirror join greetings and
!ai replies into a Discord channel via
a plain incoming webhook. Off by default; no bridge plugin required.
- In-game admin commands — view and change most settings from chat (
/mcaichatbot config,
get, set, models) with no restart needed, or just reload after a manual file edit.
- Crash-safe state persistence — cooldowns and conversation memory survive restarts.
Supported platforms
| Platform |
mc versions |
| Paper |
one jar, forward-compatible from 1.21.11 through the 26.x line |
| Fabric |
1.21.11, 26.1, 26.2 |
| Forge |
1.21.11, 26.1, 26.2 |
| NeoForge |
1.21.11, 26.1, 26.2 |
Every platform uses the exact same config.yml shape and keys — copy one platform's config to
another and it just works.
Setup guide
Everything you need to install, configure, and run mc AI Chatbot on any of the four supported
platforms.
Install
| Platform |
Where the jar goes |
Files generated on first start |
| Paper |
plugins/ |
plugins/mcAIChatbot/config.yml, server-info.md, kb/ |
| Fabric |
mods/ |
config/mcaichatbot/config.yml, server-info.md, kb/ |
| Forge |
mods/ |
config/mcaichatbot/config.yml, server-info.md, kb/ |
| NeoForge |
mods/ |
config/mcaichatbot/config.yml, server-info.md, kb/ |
Pick the jar matching your loader and mc version (1.21.11, 26.1, or 26.2 — Paper ships
one jar that covers all of them). Start the server once to generate the files above, then it won't
answer anything useful until you fill in two of them: an API key, and your own server info.
API key
Use a free-tier account with no payment method attached — not a paid one. This project's
config keeps apiKey as plain text in config.yml on your server's own filesystem; a free key
only risks hitting a rate limit if it ever leaks, a paid one risks a real bill. Every provider
option below has a genuine free tier that needs no card.
The shipped default is Groq — see "Quick start" above for the step-by-step signup, or
"Groq key" above for the reasoning behind the free-tier requirement.
Set these four fields under ai: in config.yml:
ai:
provider: "openai-compatible" # shipped default — see the Groq key guide below
apiKey: "..." # your own free-tier key — never share one across installs
baseUrl: "https://api.groq.com/openai/v1"
models:
- "groq/compound"
- "openai/gpt-oss-120b"
- "openai/gpt-oss-20b"
(The config also supports OpenRouter and Anthropic as alternate providers if you'd rather use
those — both have free options too — but this guide only covers the Groq path, since it's the
default and needs no extra setup beyond the key itself.)
apiKey is the one field that always needs a direct file edit — see "Admin commands" below for
every other setting. After changing this, run /mcaichatbot reload or restart the server. Pending
questions, item-give cooldowns, and conversation history all survive a reload — only
config.yml/server-info.md/kb/ get re-read. Needs op-equivalent permission (Paper:
mcaichatbot.reload, default op, alias /maic; Fabric/Forge/NeoForge: vanilla permission level 4,
same as /op).
Server info
Nothing ships pre-loaded with any particular server's content — every default is a template meant
to be replaced.
server-info.md — short, factual bullet points: server name, rules, gamemode, key
commands/plugins, links. This gets pasted into every prompt, so keep it tight.
kb/ — a folder, not a single file. Drop in as many .md files as you want for anything
server-info.md doesn't have room for (game systems, lore, item lists, event rules). Ships with
one example file showing the format — delete the example, write your own. Files are read in
filename order (01-..., 02-...) if order matters. Give things clear headings/bold text —
that's what gets matched against a player's question.
Both are re-read live on every question — no reload needed for these two.
Item giving
itemGiving:
enabled: false # master switch (shipped default) — true lets the bot give items when asked
maxPerDay: 10 # per player, rolling 24h window
maxQuantity: 64 # ordinary stackable items
maxEquipmentQuantity: 1 # weapons/armor/tools/etc (vanilla max stack size 1 anyway)
Turning enabled: false doesn't just stop gives from happening — the AI is told never to offer
one, and if it ignores that, the plugin overrides its reply with a plain "item giving is off here"
message instead of letting a promised-but-undelivered item slip through.
Other tunables
| Key |
What it does |
botName |
the name shown in chat before every bot message, default "mcAi" |
chatStyle |
name/message color and bold, e.g. chatStyle.nameColor: "blue" |
personality |
"friendly" or "trashtalk" — the bot's tone |
askPrefix |
the chat prefix players type, default "!ai" |
batchWindowMs |
how often queued questions go out as one AI call (default 10s) |
maxAsksPerWindow |
total questions accepted per window, across all players |
askCooldownSeconds |
per-player pacing independent of batchWindowMs |
maxAskSubparts |
how many distinct requests one message can resolve at once |
broadcastReplies |
true = bot replies go to server-wide chat; false = console log only |
Every key in this table (and item-giving's, above) can also be changed from chat — see
"Admin commands" below.
Discord relay
Every bot chat line (join greetings, !ai replies) can be relayed into a Discord channel via an
incoming webhook — no bridge plugin needed, off by default:
- In Discord: target channel → Settings → Integrations → Webhooks → New Webhook → Copy Webhook
URL.
- In
config.yml:
discord:
webhookUrl: "https://discord.com/api/webhooks/..."
username: "" # optional — overrides the name Discord shows; blank uses the webhook's own
/mcaichatbot reload or restart.
Leave webhookUrl blank (the default) to keep this off. A relay failure (bad URL, Discord down,
rate-limited) is logged and dropped; it never affects the in-game reply that triggered it.
Admin commands
Most of config.yml can be changed from in-game chat instead of hand-editing the file:
/mcaichatbot config — lists every editable key and its current value.
/mcaichatbot get <key> / /mcaichatbot set <key> <value> — view or change one, e.g.
/mcaichatbot set chatStyle.nameColor red or /mcaichatbot set personality trashtalk.
/mcaichatbot models list|add|remove <id> — manage the ai.models list.
/mcaichatbot reload — re-read config.yml/server-info.md/kb/ after a manual file edit.
Every set/add/remove above reloads automatically — no separate /mcaichatbot reload needed.
ai.apiKey is the one exception: it's never viewable or settable via command (a secret shouldn't
be echoed into chat or server logs), so that field alone still needs a direct edit to config.yml.
Same permission as reload (see "API key" above).
Security notes
- Use a free-tier API key and Discord webhook — see "Free key" above for why.
- Never commit
config.yml with a real key in it anywhere, and never hand out a jar/config with
your key baked in — every install needs its own.
- If a key ever ends up somewhere it shouldn't (pasted in chat, committed to a public repo, etc.),
rotate it at the provider's console immediately — don't just remove it from wherever it leaked.
评论 0
登录后参与评分
还没有评论,来抢沙发吧