SyAI - Minecraft AI 集成插件
SyAI 将 Minecraft 玩家与 AI 模型连接,支持在游戏内直接进行 AI 驱动的聊天对话和自主任务执行。
支持的 AI 模型
| 模型 |
提供商 |
API 格式 |
deepseek-v4-pro |
DeepSeek |
OpenAI |
deepseek-v4-flash |
DeepSeek |
OpenAI |
kimi-k2-6 |
Kimi (Moonshot) |
OpenAI |
qwen3.7-plus |
Qwen (Alibaba) |
OpenAI |
qwen3.7-max |
Qwen (Alibaba) |
OpenAI |
glm-5.1 |
GLM (ZhipuAI) |
OpenAI |
minimax-m3 |
MiniMax |
Anthropic |
安装
- 下载
SyAI.jar 并将其放入服务器的 plugins/ 文件夹中。
- 启动或重启服务器。
- 编辑
plugins/SyAI/config.yml 以配置 API 密钥(详见下文)。
- 使用
/syai reload 重新加载配置,无需重启服务器。
配置 (config.yml)
# 是否使用管理员提供的 API 密钥
# 如果为 true,玩家将使用下面配置的密钥
# 如果为 false,玩家必须通过 /syai api 提供自己的 API 密钥
use-admin-api: true
# 管理员 API 密钥(仅在 use-admin-api 为 true 时使用)
admin-api-keys:
deepseek-v4-pro: "sk-your-key-here"
deepseek-v4-flash: "sk-your-key-here"
kimi-k2-6: "sk-your-key-here"
qwen3.7-plus: "sk-your-key-here"
qwen3.7-max: "sk-your-key-here"
glm-5.1: "your-key-here"
minimax-m3: "your-key-here"
# 聊天和任务的默认模型
default-model: "deepseek-v4-flash"
# 聊天最大上下文消息数量
max-context: 100
# AI 任务设置
task:
max-rounds: 50
action-delay: 10
两种 API 密钥模式
管理员模式 (use-admin-api: true):
所有玩家共享由管理员配置的 API 密钥。玩家无需进行任何配置。
玩家模式 (use-admin-api: false):
每位玩家必须使用 /syai api <model> <key> 提供自己的 API 密钥。密钥存储在本地 JSON 文件 (api_keys.json) 中。
命令
| 命令 |
描述 |
/syai chat true |
启用 AI 聊天模式 — 所有消息都将发送给 AI |
/syai chat false |
禁用 AI 聊天模式 |
/syai task <requirement> |
让 AI 接管你的客户端以完成任务 |
/syai task cancel |
取消当前的 AI 任务 |
/syai api <model> <key> |
为某个模型设置你的个人 API 密钥 |
/syai model [name] |
查看或更改你当前激活的模型 |
/syai status |
查看你当前的状态 |
/syai reload |
重新加载配置(仅限管理员) |
AI 聊天模式
当聊天模式启用时,玩家在聊天中发送的每一条消息都会转发给 AI。AI 会结合对话上下文进行回复。
- 每位玩家保留 100 条消息 的上下文。
- AI 知晓玩家的 Minecraft 用户名。
- AI 会使用玩家所使用的相同语言进行回复。
- 当禁用聊天模式或玩家登出时,上下文会被清除。
AI 任务模式
AI 任务允许 AI 接管玩家的客户端并在世界中执行操作。AI 使用 函数调用(工具使用) 与游戏进行交互。
可用工具(共 18 个)
| 工具 |
描述 |
execute_command |
执行玩家命令(管理命令被禁止) |
send_message |
发送聊天消息 |
move_to |
传送至指定坐标 |
move_forward |
沿面向方向前进 |
look_at |
改变视角方向(偏航角/俯仰角) |
get_position |
获取当前位置和方向 |
get_inventory |
查看物品栏内容 |
place_block |
从物品栏放置方块 |
break_block |
破坏方块 |
attack_entity |
攻击最近的实体 |
interact_chest |
查看/存入/取出箱子物品 |
drop_item |
丢弃物品栏中的物品 |
switch_hotbar |
切换手持快捷栏槽位(0-8) |
switch_hand_item |
交换两个物品栏槽位之间的物品 |
use_item |
消耗/使用手持物品 |
get_nearby_blocks |
扫描附近的方块 |
get_nearby_entities |
列出附近的实体 |
finish_task |
标记任务完成 |
命令安全性
出于安全考虑,AI 无法执行管理命令。以下类型的命令将被阻止:
- 封禁/惩罚:
/ban, /ban-ip, /kick, /mute, /warn, /jail, /tempban, /ipban, /pardon, /unban, /unmute
- 操作员权限:
/op, /deop, /stop, /restart, /reload, /plugins, /pl, /whitelist
- 游戏操控:
/kill, /gamemode, /give, /xp, /enchant, /effect, /summon, /clear, /difficulty, /gamerule, /time, /weather
- 世界编辑:
/setblock, /fill, /clone, /setworldspawn, /worldborder, // (WorldEdit)
- 经济操控:
/eco, /economy, /money give, /money take, /money set
- 权限管理:
/lp, /luckperms, /perm, /pex, /groupmanager
- 服务器控制:
/save-all, /save-off, /save-on, /timings, /spark, /paper, /purpur
- 入侵行为:
/invsee, /openinv, /vanish, /sudo, /force, /socialspy, /spectate
允许的命令 包括:/tpa, /tpahere, /tpaccept, /res tp, /money, /pay, /home, /spawn, /warp, /msg, /kit, /trade, /shop, /ah, /fly, /nick 以及其他常见的玩家命令。
权限
| 权限 |
默认值 |
描述 |
syai.use |
true (所有人) |
访问所有 SyAI 命令 |
syai.admin |
op |
访问 /syai reload |
API 密钥隐私
- 玩家 API 密钥本地存储在
plugins/SyAI/api_keys.json(JSON 文件)中。
- 密钥绝不会传输给第三方——它们仅用于调用相应 AI 提供商的 API。
- 当启用
use-admin-api 时,不需要单独的 Player 密钥。
SyAI - AI Integration Plugin for Minecraft
SyAI connects Minecraft players to AI models, enabling AI-powered chat conversations and autonomous task execution directly in-game.
Supported AI Models
| Model |
Provider |
API Format |
deepseek-v4-pro |
DeepSeek |
OpenAI |
deepseek-v4-flash |
DeepSeek |
OpenAI |
kimi-k2-6 |
Kimi (Moonshot) |
OpenAI |
qwen3.7-plus |
Qwen (Alibaba) |
OpenAI |
qwen3.7-max |
Qwen (Alibaba) |
OpenAI |
glm-5.1 |
GLM (ZhipuAI) |
OpenAI |
minimax-m3 |
MiniMax |
Anthropic |
Installation
- Download
SyAI.jar and place it in your server's plugins/ folder.
- Start/restart the server.
- Edit
plugins/SyAI/config.yml to configure API keys (see below).
- Use
/syai reload to reload configuration without restarting.
Configuration (config.yml)
# Whether to use admin-provided API keys
# If true, players will use the keys configured below
# If false, players must provide their own API keys via /syai api
use-admin-api: true
# Admin API keys (only used if use-admin-api is true)
admin-api-keys:
deepseek-v4-pro: "sk-your-key-here"
deepseek-v4-flash: "sk-your-key-here"
kimi-k2-6: "sk-your-key-here"
qwen3.7-plus: "sk-your-key-here"
qwen3.7-max: "sk-your-key-here"
glm-5.1: "your-key-here"
minimax-m3: "your-key-here"
# Default model for chat and tasks
default-model: "deepseek-v4-flash"
# Maximum context messages for chat
max-context: 100
# AI task settings
task:
max-rounds: 50
action-delay: 10
Two API Key Modes
Admin Mode (use-admin-api: true):
All players share the API keys configured by the admin. Players do not need to configure anything.
Player Mode (use-admin-api: false):
Each player must provide their own API key using /syai api <model> <key>. Keys are stored in a local JSON file (api_keys.json).
Commands
| Command |
Description |
/syai chat true |
Enable AI chat mode — all messages are sent to AI |
/syai chat false |
Disable AI chat mode |
/syai task <requirement> |
Let AI take over your client to complete a task |
/syai task cancel |
Cancel the current AI task |
/syai api <model> <key> |
Set your personal API key for a model |
/syai model [name] |
View or change your active model |
/syai status |
View your current status |
/syai reload |
Reload configuration (admin only) |
AI Chat Mode
When chat mode is enabled, every message the player sends in chat is forwarded to the AI. The AI responds with the conversation context.
- 100 messages of context are maintained per player.
- The AI is aware of the player's Minecraft username.
- The AI responds in the same language the player uses.
- Context is cleared when chat mode is disabled or the player logs out.
AI Task Mode
AI tasks allow the AI to take control of a player's client and perform actions in the world. The AI uses function calling (tool use) to interact with the game.
Available Tools (18 tools)
| Tool |
Description |
execute_command |
Execute a player command (admin commands are blocked) |
send_message |
Send a chat message |
move_to |
Teleport to specific coordinates |
move_forward |
Move forward in the facing direction |
look_at |
Change view direction (yaw/pitch) |
get_position |
Get current position and direction |
get_inventory |
View inventory contents |
place_block |
Place a block from inventory |
break_block |
Break a block |
attack_entity |
Attack the nearest entity |
interact_chest |
View/deposit/withdraw chest items |
drop_item |
Drop items from inventory |
switch_hotbar |
Switch held hotbar slot (0-8) |
switch_hand_item |
Swap items between two inventory slots |
use_item |
Consume/use held item |
get_nearby_blocks |
Scan nearby blocks |
get_nearby_entities |
List nearby entities |
finish_task |
Signal task completion |
Command Security
For security, AI cannot execute administrative commands. The following command types are blocked:
- Bans/punishment:
/ban, /ban-ip, /kick, /mute, /warn, /jail, /tempban, /ipban, /pardon, /unban, /unmute
- Operator:
/op, /deop, /stop, /restart, /reload, /plugins, /pl, /whitelist
- Game manipulation:
/kill, /gamemode, /give, /xp, /enchant, /effect, /summon, /clear, /difficulty, /gamerule, /time, /weather
- World editing:
/setblock, /fill, /clone, /setworldspawn, /worldborder, // (WorldEdit)
- Economy manipulation:
/eco, /economy, /money give, /money take, /money set
- Permissions:
/lp, /luckperms, /perm, /pex, /groupmanager
- Server control:
/save-all, /save-off, /save-on, /timings, /spark, /paper, /purpur
- Invasion:
/invsee, /openinv, /vanish, /sudo, /force, /socialspy, /spectate
Allowed commands include: /tpa, /tpahere, /tpaccept, /res tp, /money, /pay, /home, /spawn, /warp, /msg, /kit, /trade, /shop, /ah, /fly, /nick, and other common player commands.
Permissions
| Permission |
Default |
Description |
syai.use |
true (everyone) |
Access to all SyAI commands |
syai.admin |
op |
Access to /syai reload |
API Key Privacy
- Player API keys are stored locally in
plugins/SyAI/api_keys.json (JSON file).
- Keys are never transmitted to third parties — they are only used to call the respective AI provider's API.
- When
use-admin-api is enabled, individual player keys are not required.
.
评论 0
登录后参与评分
还没有评论,来抢沙发吧