Minecraft Server Admin
Scope: This skill is your in-game remote control for a Minecraft Java server.
It sends commands through the RCON protocol to manage players, world state, and
server communication in real time. It intentionally excludes server-infrastructure
operations such as process lifecycle management, filesystem backups, plugin jar
installation, and continuous uptime monitoring; use a dedicated PaperMC ops skill
for those. This skill does NOT require minecraft-bridge — it communicates directly
with the server's admin console over a separate TCP connection.
Architecture:
OpenClaw → RCON TCP (port 25575) → Minecraft Server Console
Prerequisites
Enable RCON on the Server
Edit server.properties:
enable-rcon=true
rcon.port=25575
rcon.password=STRONG_PASSWORD_HERE
broadcast-rcon-to-ops=false
Restart server after changing these values.
Environment Variables
CODEBLOCK2
Verify Connection
CODEBLOCK3
Operation Categories
PLAYER MANAGEMENT
For any player-related command, use: INLINECODE1
Listing & Checking
- - "who is online" →
/list → parse player count and names - "is [player] online" →
/list then check if name appears
Access Control ⚠️ Requires confirmation before executing:
- - kick: INLINECODE4
- temp ban:
/ban <player> [reason] + calendar note - permanent ban: INLINECODE6
- ban IP: INLINECODE7
- unban:
/pardon <player> or INLINECODE9 - whitelist add: INLINECODE10
- whitelist remove: INLINECODE11
- op player:
/op <player> ⚠️ HIGH PRIVILEGE — always confirm - deop player: INLINECODE13
Item & State Management
- - give items: INLINECODE14
- clear inventory: INLINECODE15
- set gamemode: INLINECODE16
- teleport:
/tp <player> <x> <y> <z> or INLINECODE18 - set health/hunger: INLINECODE19
- heal player: INLINECODE20
WORLD MANAGEMENT
Time & Weather
- - day: INLINECODE21
- night: INLINECODE22
- sunrise: INLINECODE23
- clear weather: INLINECODE24
- rain: INLINECODE25
- thunder: INLINECODE26
World State
- - save world:
/save-all (always do before maintenance) - save-off (for backup):
/save-off then backup then INLINECODE29 - change difficulty: INLINECODE30
- set game rule: INLINECODE31
- Examples:
keepInventory true,
doDaylightCycle false,
doFireTick false
- - find structure: INLINECODE35
- fill area:
/fill <x1 y1 z1> <x2 y2 z2> <block> ⚠️ Confirm range before running
Entity Management
- - kill all mobs:
/kill @e[type=!player] ⚠️ Confirm — kills all non-players - kill specific type: INLINECODE38
- remove dropped items: INLINECODE39
BROADCAST & COMMUNICATION
- - server message:
/say <message> (prefixed with [Server]) - title on screen: INLINECODE41
- subtitle: INLINECODE42
- private message: INLINECODE43
- actionbar: INLINECODE44
PERFORMANCE MONITORING
When asked about server performance:
- 1. Execute
/list → check player count - Read
MC_SERVER_LOG file (last 200 lines) if path set - Look for patterns in INLINECODE47
- Report: TPS warnings, error frequency, player activity spikes
Safety Protocols
Confirmation required for all destructive/high-privilege commands:
CODEBLOCK4
Operations requiring confirmation:
- -
ban, ban-ip — permanent account restriction - INLINECODE50 — grants admin privileges
- INLINECODE51 — large area modification
- INLINECODE52 — entity mass-removal
- INLINECODE53 — server shutdown
- INLINECODE54 — pauses auto-save (dangerous if forgotten)
Audit logging: After each operation, append to OpenClaw Memory:
## Server Admin Log [ISO timestamp]
- Command: /ban PlayerX "repeated griefing"
- Executed by: [OpenClaw user]
- Result: success
Response Formatting
Player List (/list response)
Parse and present as:
CODEBLOCK6
Kicked/Banned confirmation
CODEBLOCK7
Error Responses
- - Connection refused → check RCON settings, server running?
- Authentication failure → wrong MCRCONPASSWORD
- Command returned empty → server may not have recognized command (check version)
Log Analysis
When user asks about server health or player history:
- 1. Check
MC_SERVER_LOG is set and file exists - Read the last N lines: INLINECODE57
- Apply patterns from INLINECODE58
- Summarize findings:
CODEBLOCK8
Additional Resources
- -
references/commands.md — All vanilla commands with syntax and permission level - INLINECODE60 — Common log patterns and what they mean
- INLINECODE61 — RCON client (used by all commands above)
- INLINECODE62 — Log parsing utilities
Minecraft 服务器管理员
范围:此技能是你在Minecraft Java版服务器中的游戏内远程控制工具。
它通过RCON协议发送命令,实时管理玩家、世界状态和服务器通信。它特意排除了服务器基础设施操作,如进程生命周期管理、文件系统备份、插件jar安装和持续运行时间监控;这些操作请使用专用的PaperMC运维技能。此技能不需要minecraft-bridge——它通过独立的TCP连接直接与服务器的管理控制台通信。
架构:
OpenClaw → RCON TCP (端口 25575) → Minecraft服务器控制台
前置条件
在服务器上启用RCON
编辑 server.properties:
properties
enable-rcon=true
rcon.port=25575
rcon.password=强密码
broadcast-rcon-to-ops=false
修改这些值后重启服务器。
环境变量
MCRCONHOST=localhost # 服务器IP或主机名
MCRCONPORT=25575 # RCON端口(必须与server.properties一致)
MCRCONPASSWORD=yourpassword # RCON密码(必须与server.properties一致)
MCSERVERLOG=/path/to/server/logs/latest.log # 可选,用于日志分析
验证连接
bash
node ~/.openclaw/skills/minecraft-server-admin/scripts/rcon.js list
预期输出:当前有N名玩家在线,最大在线人数为M:...
操作分类
玩家管理
对于任何与玩家相关的命令,使用:scripts/rcon.js <命令>
列出与检查
- - 谁在线 → /list → 解析玩家数量和名称
- [玩家]是否在线 → /list 然后检查名称是否出现
访问控制 ⚠️ 执行前需要确认:
- - 踢出:/kick <玩家> [原因]
- 临时封禁:/ban <玩家> [原因] + 日历备注
- 永久封禁:/ban <玩家> [原因]
- 封禁IP:/ban-ip <玩家|IP> [原因]
- 解封:/pardon <玩家> 或 /pardon-ip
- 添加白名单:/whitelist add <玩家>
- 移除白名单:/whitelist remove <玩家>
- 赋予管理员:/op <玩家> ⚠️ 高权限——始终需要确认
- 撤销管理员:/deop <玩家>
物品与状态管理
- - 给予物品:/give <玩家> <物品ID> [数量]
- 清空背包:/clear <玩家> [物品] [数量]
- 设置游戏模式:/gamemode <生存|创造|冒险|旁观> <玩家>
- 传送:/tp <玩家> 或 /tp <玩家> <目标玩家>
- 设置生命/饥饿值:/effect give <玩家> minecraft:regeneration ...
- 治疗玩家:/effect give <玩家> minecraft:instant_health 1 10
世界管理
时间与天气
- - 白天:/time set day
- 夜晚:/time set midnight
- 日出:/time set 0
- 晴天:/weather clear [秒数]
- 雨天:/weather rain [秒数]
- 雷暴:/weather thunder [秒数]
世界状态
- - 保存世界:/save-all(维护前始终执行)
- 关闭自动保存(用于备份):/save-off 然后备份,再执行 /save-on
- 更改难度:/difficulty <和平|简单|普通|困难>
- 设置游戏规则:/gamerule <规则> <值>
- 示例:keepInventory true、doDaylightCycle false、doFireTick false
- - 查找结构:/locate structure minecraft:<结构名称>
- 填充区域:/fill <方块> ⚠️ 执行前确认范围
实体管理
- - 杀死所有生物:/kill @e[type=!player] ⚠️ 需要确认——会杀死所有非玩家实体
- 杀死特定类型:/kill @e[type=minecraft:zombie]
- 移除掉落物:/kill @e[type=minecraft:item]
广播与通信
- - 服务器消息:/say <消息>(前缀为[服务器])
- 屏幕标题:/title @a title {text:<消息>,color:gold,bold:true}
- 副标题:/title @a subtitle {text:<消息>}
- 私信:/msg <玩家> <消息>
- 动作栏:/title @a actionbar {text:<消息>}
性能监控
当被问及服务器性能时:
- 1. 执行 /list → 检查玩家数量
- 如果设置了路径,读取 MCSERVERLOG 文件(最后200行)
- 在 references/log-patterns.md 中查找模式
- 报告:TPS警告、错误频率、玩家活动峰值
安全协议
所有破坏性/高权限命令需要确认:
⚠️ 危险操作
命令:/ban SomePlayer 恶意破坏和骚扰
服务器:${MCRCONHOST}:${MCRCONPORT}
效果:永久封禁SomePlayer
输入 confirm 继续,或 cancel 取消。
需要确认的操作:
- - ban、ban-ip — 永久账号限制
- op — 授予管理员权限
- fill — 大面积区域修改
- kill @e — 实体批量移除
- stop — 服务器关闭
- save-off — 暂停自动保存(如果忘记恢复则很危险)
审计日志:每次操作后,追加到OpenClaw记忆:
服务器管理员日志 [ISO时间戳]
- - 命令:/ban PlayerX 反复恶意破坏
- 执行者:[OpenClaw用户]
- 结果:成功
响应格式
玩家列表(/list 响应)
解析并呈现为:
👥 在线玩家(3/20):
• Steve — [如果可用则显示坐标]
• Alex
• Notch
踢出/封禁确认
✅ 完成:PlayerX已被封禁
原因:恶意破坏
立即生效
撤销:/pardon PlayerX
错误响应
- - 连接被拒绝 → 检查RCON设置,服务器是否运行?
- 认证失败 → MCRCONPASSWORD错误
- 命令返回空 → 服务器可能未识别该命令(检查版本)
日志分析
当用户询问服务器健康状态或玩家历史时:
- 1. 检查 MCSERVERLOG 是否已设置且文件存在
- 读取最后N行:tail -500 <日志文件>
- 应用 references/log-patterns.md 中的模式
- 总结发现:
📊 服务器日志摘要(最近2小时)
玩家登录:14次
玩家登出:12次(2人仍在在线)
错误/警告:3次
- [15:42] 无法跟上!运行延迟2500ms
- [16:10] 正在保存世界world的区块
可疑活动:未检测到
附加资源
- - references/commands.md — 所有原版命令及其语法和权限等级
- references/log-patterns.md — 常见日志模式及其含义
- scripts/rcon.js — RCON客户端(上述所有命令使用)
- scripts/log-analyzer.js — 日志解析工具