← Back to Plugins
Integration

Plugin Minecraft

SleepyRinu By SleepyRinu 👁 16 views ▲ 0 votes

OpenClaw plugin for Minecraft server integration - chat with players in-game via AI

GitHub

Install

npm install
```

Configuration Example

{
  "channels": {
    "minecraft": {
      "enabled": true,
      "host": "your-server-address",
      "port": 25565,
      "username": "OpenClawBot",
      "auth": "offline",
      "version": "1.20.1",
      "chatPrefix": "§b[Bot]§r ",
      "respondToChat": true,
      "respondToPrivate": true,
      "commandPrefix": "!"
    }
  }
}

README

# OpenClaw Minecraft Plugin

Connect OpenClaw to Minecraft servers and chat with players in-game!

## Features

- 🎮 Connect to any Minecraft server (vanilla, Spigot, Paper, etc.)
- 💬 Forward in-game chat to OpenClaw AI
- 🤖 AI responses appear in game chat
- 🔒 Support for offline mode and Microsoft authentication
- 💭 Private message support via `/msg`

## Installation

### Prerequisites

- OpenClaw Gateway installed and running
- Node.js >= 18
- A Minecraft server to connect to

### Install dependencies

```bash
cd ~/.openclaw/extensions/minecraft
npm install
```

### Configure OpenClaw

Add to your `~/.openclaw/openclaw.json`:

```json
{
  "channels": {
    "minecraft": {
      "enabled": true,
      "host": "your-server-address",
      "port": 25565,
      "username": "OpenClawBot",
      "auth": "offline",
      "version": "1.20.1",
      "chatPrefix": "§b[Bot]§r ",
      "respondToChat": true,
      "respondToPrivate": true,
      "commandPrefix": "!"
    }
  }
}
```

### Configuration Options

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `enabled` | boolean | false | Enable the Minecraft channel |
| `host` | string | localhost | Minecraft server address |
| `port` | number | 25565 | Minecraft server port |
| `username` | string | OpenClawBot | Bot username (offline mode) or Microsoft email |
| `password` | string | - | Password for Microsoft auth |
| `auth` | string | offline | Authentication mode: "offline" or "microsoft" |
| `version` | string | - | Minecraft version (e.g., "1.20.1") |
| `chatPrefix` | string | "§b[Bot]§r " | Prefix for bot messages (supports color codes) |
| `respondToChat` | boolean | true | Respond to public chat |
| `respondToPrivate` | boolean | true | Respond to `/msg` whispers |
| `commandPrefix` | string | "!" | Command prefix (e.g., "!help") |

## Usage

### In-Game Chat

The bot will respond when:
1. Mentioned by name in chat: "OpenClawBot, hello!"
2. Sent a command with prefix: "!hello"
3. Sent a private message: `/msg OpenClawBot hello`

### Color Codes

Minecraft color codes are supported in `chatPrefix`:
- `§b` - Aqua
- `§r` - Reset
- `§e` - Yellow
- `§a` - Green
- See [Minecraft Wiki](https://minecraft.wiki/w/Formatting_codes) for all codes

## Troubleshooting

### Bot not connecting

1. Check server address and port
2. Verify Minecraft version matches
3. For online mode, ensure Microsoft credentials are correct

### Bot not responding to chat

1. Check if `respondToChat` is enabled
2. Try mentioning the bot by name
3. Use the command prefix (default: "!")

## Technical Details

- Uses [mineflayer](https://github.com/PrismarineJS/mineflayer) for Minecraft protocol
- Implements OpenClaw channel plugin interface
- Supports both public chat and private messages

## License

MIT

---

Created by Rinu 🐱 - *Hmph, I made this plugin myself! Not that I wanted to impress anyone...*
integration

Comments

Sign in to leave a comment

Loading comments...