GemServer v2.5 ?
由 MOOOODER 和 2s2ones 制作
GemServer 是一个面向 Paper 和 Spigot 服务器的全面 AI 集成方案,它利用 Google Gemini API 为玩家和管理员提供一个具有深度上下文的助手。与标准的聊天机器人不同,GemServer 可以直接访问实时服务器数据和玩家特定的上下文信息,从而提供关于游戏世界的准确信息,甚至协助进行服务器管理。
安装与设置
- 将
gemserver-plugin-2.5-SNAPSHOT.jar 放入服务器的 plugins 文件夹中。
- 重启服务器以生成配置文件。
- 从 Google AI Studio (aistudio.google.com) 获取免费或付费的 API 密钥。
- 使用游戏内命令
/api <your_key> 或手动编辑 config.yml。
- 在配置中将
accept-google-ai-tos: true 设置为启用,以解锁插件功能。
交互方式
要与 Gemini 对话,玩家只需在聊天消息开头加上短语 "Hey gemini, "。插件会取消该公共消息的处理,请求将被处理后,为向玩家打开一个包含 AI 回复内容的私有虚拟书。
示例:"Hey gemini, what biome am I currently in?"
命令与权限
以下所有命令都需要 gemserver.api 权限,该权限默认授予操作员(OP)。
- /gemini:打开主图形界面(GUI)。在这里,你可以查看个人统计数据、浏览完整的提问历史、查看你“收藏”的回复,或阅读服务器维基。
- /gemhistory:快速打开包含你之前提问记录的虚拟书。
- /api keep:当你收到 Gemini 的回复时,可以使用此命令在背包中获得该书的实体物品版本。
- /api <key>:设置当前的 Gemini API 密钥。
- /api reload:重新加载插件配置、维基数据并重置模型缓存。
配置指南
config.yml 文件允许你自定义 AI 的行为和安全设置。以下是关键部分:
# 将此设置为 true 以接受 Google AI 服务条款。
# 这是插件正常运行所必需的。
accept-google-ai-tos: false
# 防止刷屏的玩家提问冷却时间(秒)。
cooldown-seconds: 10
# 聊天安全的自动审核设置。
auto-moderation:
enabled: true
toxicity-threshold: 0.85
action: "WARN" # 选项:WARN, KICK, BAN
staff-notification: "<red>[Gemini-Mod] <white>玩家 <yellow>%player% <white>正在表现出毒性行为!得分:<red>%score%"
# 自定义知识库
# 使用此部分教 Gemini 了解你们服务器的特定规则和特性。
server-wiki: |
欢迎来到我们的服务器!
规则:1. 禁止破坏。2. 保持尊重。
命令:使用 /gemini 进入中心枢纽。
高级 AI 功能
- AI 函数调用:Gemini 可以建议并执行针对 OP 的服务器命令。例如,如果 OP 询问 "Heal me",AI 可以自动触发 /heal 命令。
- 上下文感知:AI 接收实时数据,包括玩家坐标、生物群系、生命值、饥饿值、经验值、手持物品、服务器 TPS 和内存使用情况。
- 对话记忆:AI 保留玩家最近三次提问的上下文,支持后续问题和自然对话。
- GUI 中心枢纽:一个集中式菜单,用于管理历史记录和“收藏”重要回复以供将来参考。
更新日志
v2.5-SNAPSHOT
- 对插件架构进行了全面重构。
- 实现了用于管理任务的 AI 函数调用。
- 添加了带有毒性评分的 AI 驱动自动审核功能。
- 引入了 /gemini GUI 中心枢纽,用于统计和历史记录管理。
- 添加了对自定义服务器维基知识库的支持。
- 集成了深度服务器上下文(坐标、生命值、TPS 等)。
- 添加了对话记忆功能(最近 3 次交互)。
- 添加了 /api keep 命令,用于将 AI 回复导出为实体物品。
- 集成了 PlaceholderAPI 支持。
- 实施了强制性的服务条款检查以确保合规性。
- 优化了书籍分页和颜色渲染逻辑。
GemServer v2.5 ?
Created by MOOOODER and 2s2ones
GemServer is a comprehensive AI integration for Paper and Spigot servers that utilizes the Google Gemini API to provide a deeply contextualized assistant for both players and administrators. Unlike standard chatbots, GemServer has direct access to live server data and player-specific context, allowing it to provide accurate information about the game world and even assist with server management.
Installation and Setup
- Place the
gemserver-plugin-2.5-SNAPSHOT.jar into your server's plugins folder.
- Restart the server to generate the configuration files.
- Obtain a free or paid API key from Google AI Studio (aistudio.google.com).
- Use the in-game command
/api <your_key> or edit the config.yml manually.
- In the configuration, set
accept-google-ai-tos: true to unlock the plugin's functionality.
How to Interact
To speak with Gemini, players simply need to start a chat message with the phrase "Hey gemini, ". The plugin will cancel the public message, process the request, and open a private virtual book for the player containing the AI's response.
Example: "Hey gemini, what biome am I currently in?"
Commands and Permissions
All commands below require the gemserver.api permission, which is granted to Operators (OPs) by default.
- /gemini: Opens the main graphical interface (GUI). From here, you can view your personal statistics, browse your full question history, view your "Starred" responses, or read the Server Wiki.
- /gemhistory: A quick command to open a virtual book containing your previous questions.
- /api keep: When you receive a response from Gemini, you can use this command to receive a physical, permanent version of the book in your inventory.
- /api <key>: Sets the active Gemini API key.
- /api reload: Reloads the plugin configuration, wiki data, and resets the model cache.
Configuration Guide
The config.yml file allows you to customize the AI's behavior and safety settings. Below are the key sections:
# Set this to true to accept the Google AI Terms of Service.
# This is mandatory for the plugin to function.
accept-google-ai-tos: false
# Rate limit in seconds between player questions to prevent spam.
cooldown-seconds: 10
# Auto-Moderation settings for chat safety.
auto-moderation:
enabled: true
toxicity-threshold: 0.85
action: "WARN" # Options: WARN, KICK, BAN
staff-notification: "<red>[Gemini-Mod] <white>Player <yellow>%player% <white>is being toxic! Score: <red>%score%"
# Custom Knowledge Base
# Use this section to teach Gemini about your server's specific rules and features.
server-wiki: |
Welcome to our server!
Rules: 1. No griefing. 2. Be respectful.
Commands: Use /gemini to access the hub.
Advanced AI Features
- AI Function Calling: Gemini can suggest and execute server commands for OPs. For example, if an OP asks "Heal me," the AI can trigger the /heal command automatically.
- Context Awareness: The AI receives real-time data including player coordinates, biome, health, food level, experience, held items, server TPS, and memory usage.
- Conversational Memory: The AI retains context for the last three questions asked by a player, allowing for follow-up questions and natural dialogue.
- GUI Hub: A centralized menu for managing history and "Starring" important responses for future reference.
Changelog
v2.5-SNAPSHOT
- Complete overhaul of the plugin architecture.
- Implemented AI Function Calling for administrative tasks.
- Added AI-driven Auto-Moderation with toxicity scoring.
- Introduced the /gemini GUI Hub for statistics and history management.
- Added support for a custom Server Wiki knowledge base.
- Integrated deep server context (coordinates, health, TPS, etc.).
- Added conversational memory (last 3 interactions).
- Added the /api keep command to export AI responses to physical items.
- Integrated PlaceholderAPI support.
- Implemented a mandatory Terms of Service check for legal compliance.
- Refined book pagination and color rendering logic.
评论 0
登录后参与评分
还没有评论,来抢沙发吧