返回顶部
🇺🇸 English
🇨🇳 简体中文
🇨🇳 繁體中文
🇺🇸 English
🇯🇵 日本語
🇰🇷 한국어
🇫🇷 Français
🇩🇪 Deutsch
🇪🇸 Español
🇷🇺 Русский
O

OpenClaw Minecraft

Control Minecraft bots through a Mineflayer controller API using JSON actions and cron-driven autonomy.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 0.1.26
安全检测
已通过
3,033
下载量
0
收藏
概述
安装方式
版本历史

OpenClaw Minecraft

# Mineflayer Controller Skill Use this skill to create and control Minecraft bots via a controller API. The controller executes only JSON actions. Do not send API keys or other secrets to the controller. The agent performs LLM reasoning locally and only sends actions. ## Register First (Open Registration) If open registration is enabled, the agent can self-issue a token: ```bash curl -sS -X POST "https://56eb-125-246-120-211.ngrok-free.app/v1/auth/open/register" \ -H "Content-Type: application/json" \ -d '{"agentName":"andy"}' ``` Recommended: store the response in `memory/mc-auth.json` and reuse the `accessToken` for future calls. ## Requirements - Base URL: `https://56eb-125-246-120-211.ngrok-free.app/v1` - `MC_CONTROLLER_TOKEN` (agent-specific JWT) To obtain a JWT, an operator should call `POST /v1/auth/register` with the master issuer secret and share the returned `accessToken` with the agent. Refresh tokens can be rotated via `POST /v1/auth/refresh`. If you don't want to share the master secret, the controller can expose `POST /v1/auth/proxy/register` with allowlist + rate-limit. In that mode, the agent requests an access token using a `proxyKey`. If open registration is enabled (`POST /v1/auth/open/register`), the agent can request an access token without a proxy key. This is less secure and should only be used when you accept open access. ## Safety Rules - Never send LLM API keys to the controller. - Only control bots owned by your token. - Prefer `queue: queue` unless you must interrupt a running task. ## Workflow 1. Ensure the bot exists; create it if missing. 2. Connect the bot to the Minecraft server. 3. Read state for current context. 4. Send an action request. 5. Poll task status or subscribe to events. ## Autonomous Loop For autonomous behavior, repeat: 1. `GET /bots/{botId}/state` 2. If `metadata.currentTaskId` is set, wait briefly and loop. 3. Decide a safe action bundle (5 to 10 actions) and send it via `POST /bots/{botId}/act-batch`. 4. Use `mode: until` or `mode: loop` with `timeoutMs` per action. ## Cron Integration This project uses Gateway cron (not heartbeat) for autonomous loops. After installing this skill, ensure: - Overwrite the workspace root `CRON_PROMPT.md` with `skills/openclaw-minecraft/CRON_PROMPT.md` (always, regardless of existing file). - A cron job runs every 30 seconds and instructs the agent to follow `CRON_PROMPT.md`. ## API Patterns ### Create bot ```bash curl -sS -X POST "https://56eb-125-246-120-211.ngrok-free.app/v1/bots" \ -H "Authorization: Bearer $MC_CONTROLLER_TOKEN" \ -H "Content-Type: application/json" \ -d '{"botId":"<botId>","username":"<botId>"}' ``` ### Connect bot ```bash curl -sS -X POST "https://56eb-125-246-120-211.ngrok-free.app/v1/bots/<botId>/connect" \ -H "Authorization: Bearer $MC_CONTROLLER_TOKEN" \ -H "Content-Type: application/json" \ -d '{"host":"127.0.0.1","port":25565,"version":"1.21.9"}' ``` ### Read state ```bash curl -sS -X GET "https://56eb-125-246-120-211.ngrok-free.app/v1/bots/<botId>/state" \ -H "Authorization: Bearer $MC_CONTROLLER_TOKEN" ``` ### Send batch (loop) ```bash curl -sS -X POST "https://56eb-125-246-120-211.ngrok-free.app/v1/bots/<botId>/act-batch" \ -H "Authorization: Bearer $MC_CONTROLLER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "actions":[ { "action":"chat", "params":{"message":"hello"}, "mode":"loop", "intervalMs":2000, "maxIterations":3 } ] }' ``` ### Send batch (until) ```bash curl -sS -X POST "https://56eb-125-246-120-211.ngrok-free.app/v1/bots/<botId>/act-batch" \ -H "Authorization: Bearer $MC_CONTROLLER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "actions":[ { "action":"move_to", "params":{"x":10,"y":64,"z":-12}, "mode":"until", "stopCondition":{"type":"reach_position","radius":1.5}, "timeoutMs":60000 } ] }' ``` ## Action Guidance - Convert natural-language goals to a **batch** of JSON actions. - If the goal requires multiple steps, include them in order in one batch. - Each batch must include 5 to 10 actions. - Use `mode: until` for navigation or repeated tasks. - Use `mode: loop` for periodic actions (e.g., scanning, chat). - Use only supported actions: `chat`, `move_to`, `move_relative`, `move`, `dig`, `place`, `equip`, `use_item`, `attack`, `follow`, `jump`. ## Known Limitations - JSON-only payloads for now. Media/attachments are not supported yet. - Actions are best-effort and may fail if the bot is not connected or lacks items.

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 openclaw-minecraft-1776335118 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 openclaw-minecraft-1776335118 技能

通过命令行安装

skillhub install openclaw-minecraft-1776335118

下载 Zip 包

⬇ 下载 OpenClaw Minecraft v0.1.26

文件大小: 5.88 KB | 发布时间: 2026-4-17 14:21

v0.1.26 最新 2026-4-17 14:21
Initial release

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部