{"key":"minecraft_ai_bot_test_server_2026_05_03","title":"Minecraft AI Bot Test Server","content":"# BinkieBot — Minecraft AI Bot\n\n## Server\n- **Host:** svc-minecraft, IP 192.168.4.112\n- **Minecraft port:** 25566 (Paper 1.21.1, survival/normal, standard terrain)\n- **RCON port:** 25576, password in service env (RCON_PASSWORD)\n- **Player username:** AccursedBinkie\n\n## RCON Web UI\n- **Host machine:** svc-minecraft\n- **URL:** `http://192.168.4.112:25580`\n- **Web username:** `admin`\n- **Web password:** `EgkP2fJipDgGGMVfbeK+ibJRZkP1ySms`\n- **Remote app path:** `/home/svc-admin/docker/binkiecraft-rcon-web`\n- **Container binding:** `192.168.4.112:25580->8080/tcp`\n- **Purpose:** LAN-only basic-auth web UI that keeps the RCON password server-side and sends Minecraft commands through the web app\n- **RCON target used by web app:** `RCON_HOST=192.168.4.112`, `RCON_PORT=25575`\n- **Recorded verification:** unauthenticated `GET /` returned `401`; authenticated `POST` with `command=list` returned `There are 0 of a max of 20 players online:`; `binkiecraft-java` remained healthy\n\n## SSH Access\n- **From:** svc-ai (or any homelab host)\n- **Command:** `ssh -i /home/svc-admin/.ssh/id_ed25519_homelab svc-admin@192.168.4.112`\n- **Key:** `/home/svc-admin/.ssh/id_ed25519_homelab`\n- **User:** svc-admin\n\n## Bot Files\n- **Source of truth (edit here):** `/tmp/bot_new.js` on svc-ai\n- **Deployed file:** `/home/svc-admin/projects/minecraft-ai-bot/bot.js` on svc-minecraft (~1,950 lines, single file)\n- **Service:** `/home/svc-admin/.config/systemd/user/minecraft-ai-bot.service`\n- **Package:** `/home/svc-admin/projects/minecraft-ai-bot/package.json` (mineflayer 4.37.1, mineflayer-pathfinder 2.4.5)\n\n## Deploy Workflow\n```\nnode --check /tmp/bot_new.js\nscp -i /home/svc-admin/.ssh/id_ed25519_homelab /tmp/bot_new.js svc-admin@192.168.4.112:/home/svc-admin/projects/minecraft-ai-bot/bot.js\nssh -i /home/svc-admin/.ssh/id_ed25519_homelab svc-admin@192.168.4.112 \"node --check bot.js && systemctl --user restart minecraft-ai-bot\"\njournalctl --user -u minecraft-ai-bot -n 30\n```\n\n## RCON Quick Command (from svc-minecraft)\n```python\npython3 -c \"\nimport socket, struct\ndef rcon(host, port, password, command):\n    s = socket.socket(); s.connect((host, port))\n    def send(pid, t, b):\n        bb = b.encode(); pl = 4+4+len(bb)+2; p = struct.pack('<iii', pl, pid, t)+bb+b'\\x00\\x00'; s.send(p)\n    def recv():\n        l = struct.unpack('<i', s.recv(4))[0]; return s.recv(l)\n    send(1,3,password); recv(); send(2,2,command); return recv()[8:-2].decode()\nprint(rcon('127.0.0.1', 25576, 'a7KkTk3wojf/XI+aeUOtO58Yj4pivLUx', 'tp BinkieBot AccursedBinkie'))\n\"\n```\n\n## Service Environment Variables\n```\nMC_HOST=127.0.0.1\nMC_PORT=25566\nMC_VERSION=1.21.1\nBOT_USERNAME=BinkieBot\nRCON_HOST=127.0.0.1\nRCON_PORT=25576\nRCON_PASSWORD=a7KkTk3wojf/XI+aeUOtO58Yj4pivLUx\n```\n\n## Capabilities\n- **Navigation:** come (RCON-assisted, works from any distance), follow, stop, jump, look, where, dig nav on/off\n- **Goals:** survive, tools, iron tools, wood, stone, farm, shelter, base, explore\n- **Mining:** `bot mine <block>`, `bot mine staircase [depth]`, `bot mine strip [length]`, `bot mine safely <ore> [count]`\n- **Smelting:** `bot smelt <item> [count]`, `bot smelt food` / `bot cook`\n- **Farming:** `bot farm setup`, `bot farm harvest`, `bot breed <animal>`\n- **Building:** `bot build shelter`, `bot light up`, `bot sleep`\n- **Storage:** store, deposit, retrieve\n- **Crafting/inventory:** craft, equip, place, toss, inv, pickup\n- **Combat:** guard on/off, attack, eat\n- **Autonomous mode:** `bot auto on/off/status` — 15s decision loop\n\n## Autonomous Priority Order\ncritical health/food → sleep if night + bed → food < 8 → stone tools → furnace → coal → iron ore → smelt iron → iron tools → farm → base → explore\n\n## Key Implementation Details\n- **Tool auto-equip:** `equipBestToolForBlock` — axe/pickaxe/shovel/hoe by block type, ranked by material tier\n- **Weapon auto-equip:** `equipBestWeapon` — best sword or axe\n- **`comeToPlayer`:** async; uses entity if in render distance, otherwise queries coordinates via RCON (`/data get entity <name> Pos`), pathfinds with `allowNavigationDig=true`, hands off to GoalFollow on arrival\n- **Staircase (`digStaircase`):**\n  - Pre-checks for pickaxe; if missing, calls `ensureBasicTools()` (wood → planks → sticks → table → wooden pick → cobblestone → stone pick)\n  - 2-wide × 4-high cross section; digs directly adjacent blocks (dy=-1,0,1,2 × side=0,1)\n  - Movement via `setControlState('forward')` + position-wait loop (NOT pathfinder — pathfinder fails on drop-steps)\n  - Water safety: checks all 6 neighbors before each dig; aborts if water detected; monitors `bot.oxygenLevel` during movement, calls `returnToSurface()` if it drops\n  - Torches every 8 steps on back wall\n- **Strip mine:** 2-tall tunnels, GoalBlock forward, torches every 8 blocks\n- **Shelter:** 5×5 hollow box, 2-wide door gap (dx=0 and dx=1 at south face), pre-clears door opening before building walls\n- **Farming:** tills dirt within 4 blocks of water, plants wheat/carrots/potatoes, harvests by checking `block.getProperties().age`\n- **Smelting:** finds/crafts/places furnace, adds fuel (coal/planks), polls output slot\n- **Autonomous mode:** timer clears on disconnect, restarts on respawn if `autonomousMode=true`\n\n## Known Issues / In Progress\n- Staircase forward movement uses direct controls; the bot may not descend perfectly on every terrain type\n- `bot follow` still requires player to be in render distance for continuous GoalFollow tracking","summary":"BinkieBot is a Mineflayer Node 22 bot running on svc-minecraft (192.168.4.112:25566, Paper 1.21.1). The server also has a LAN-only custom RCON web UI on 192.168.4.112:25580 with basic auth, stored alongside the existing RCON and bot deployment details.","status":"active","namespace":"minecraft-ai:project","namespace_name":"minecraft-ai","namespace_tier":"project","tags":["minecraft-ai","minecraft","svc-minecraft","ai-bots","paper","rcon","mineflayer","nodejs","systemd","survival","planner","pathfinding","storage","tools","combat","smelting","farming","building","mining","autonomous","ssh","binkiebot","webui","basic-auth"]}