refactor(minecraft): migrate project root files

Co-authored-by: RainbowBird <44741987+luoling8192@users.noreply.github.com>
This commit is contained in:
Neko Ayaka
2025-02-14 17:26:15 +08:00
co-authored by RainbowBird
parent 219407aaca
commit 9810d3403d
8 changed files with 2022 additions and 18 deletions
+5
View File
@@ -9,12 +9,14 @@ words:
- airi-vtuber
- Attributify
- audioworklet
- awilix
- Ayaka
- bigserial
- Bitstream
- bumpp
- catppuccin
- cientos
- collectblock
- composables
- crossws
- csmmap
@@ -64,12 +66,14 @@ words:
- logg
- Maru
- micvad
- mineflayer
- mkdist
- moeru
- Morioki
- Myriam
- Neko
- nekomeowww
- neuri
- Neuro
- Neuro-sama
- nuxi
@@ -88,6 +92,7 @@ words:
- pixi
- pixiv
- pretrained
- prismarine
- pthread
- rehype
- rushstack
+1808 -18
View File
File diff suppressed because it is too large Load Diff
+10
View File
@@ -0,0 +1,10 @@
OPENAI_API_BASEURL=''
OPENAI_API_KEY=''
OPENAI_MODEL='deepseek-chat'
OPENAI_REASONING_MODEL='deepseek-reasoner'
BOT_USERNAME=''
BOT_HOSTNAME=''
BOT_PORT=''
BOT_PASSWORD=''
BOT_VERSION=''
+114
View File
@@ -0,0 +1,114 @@
# ⛏️ Minecraft agent player for [アイリ (Airi)](https://airi.moeru.ai)
> [!NOTE]
>
> This project is part of the [Project アイリ (Airi)](https://github.com/moeru-ai/airi), we aim to build a LLM-driven VTuber like [Neuro-sama](https://www.youtube.com/@Neurosama) (subscribe if you didn't!) if you are interested in, please do give it a try on [live demo](https://airi.moeru.ai).
An intelligent Minecraft bot powered by LLM. AIRI can understand natural language commands, interact with the world, and assist players in various tasks.
## 🎥 Preview
![demo](./docs/preview.png)
## ✨ Features
- 🗣️ Natural language understanding
- 🏃‍♂️ Advanced pathfinding and navigation
- 🛠️ Block breaking and placing
- 🎯 Combat and PvP capabilities
- 🔄 Auto-reconnect on disconnection
- 📦 Inventory management
- 🤝 Player following and interaction
- 🌍 World exploration and mapping
## 🚀 Getting Started
### 📋 Prerequisites
- 📦 Node.js 22+
- 🔧 pnpm
- 🎮 A Minecraft server (1.20+)
### 🔨 Installation
1. Clone the repository:
```bash
git clone https://github.com/moeru-ai/airi.git
cd services/minecraft
```
2. Install dependencies:
```bash
pnpm install
```
3. Create a `.env.local` file with your configuration:
```env
OPENAI_API_KEY=your_openai_api_key
OPENAI_API_BASEURL=your_openai_api_baseurl
BOT_USERNAME=your_bot_username
BOT_HOSTNAME=localhost
BOT_PORT=25565
BOT_PASSWORD=optional_password
BOT_VERSION=1.20
```
4. Start the bot:
```bash
pnpm dev
```
## 🎮 Usage
Once the bot is connected, you can interact with it using chat commands in Minecraft. All commands start with `#`.
### Basic Commands
- `#help` - Show available commands
- `#follow` - Make the bot follow you
- `#stop` - Stop the current action
- `#come` - Make the bot come to your location
### Natural Language Commands
You can also give the bot natural language commands, and it will try to understand and execute them. For example:
- "Build a house"
- "Find some diamonds"
- "Help me fight these zombies"
- "Collect wood from nearby trees"
## 🛠️ Development
### Project Structure
```
src/
├── agents/ # AI agent implementations
├── composables/# Reusable composable functions
├── libs/ # Core library code
├── mineflayer/ # Mineflayer plugin implementations
├── prompts/ # AI prompt templates
├── skills/ # Bot skills and actions
└── utils/ # Utility functions
```
### Commands
- `pnpm dev` - Start the bot in development mode
- `pnpm lint` - Run ESLint
- `pnpm typecheck` - Run TypeScript type checking
- `pnpm test` - Run tests
## 🙏 Acknowledgements
- https://github.com/kolbytn/mindcraft
## 🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

+53
View File
@@ -0,0 +1,53 @@
{
"name": "@proj-airi/minecraft-bot",
"type": "module",
"version": "1.0.0",
"packageManager": "pnpm@9.15.5",
"description": "An intelligent Minecraft bot powered by LLM. AIRI can understand natural language commands, interact with the world, and assist players in various tasks.",
"main": "src/main.ts",
"scripts": {
"dev": "dotenvx run -f .env -f .env.local --overload --debug --ignore=MISSING_ENV_FILE -- tsx src/main.ts",
"start": "dotenvx run -f .env -f .env.local --overload --ignore=MISSING_ENV_FILE -- tsx src/main.ts",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"typecheck": "tsc --noEmit",
"test": "vitest"
},
"dependencies": {
"@dotenvx/dotenvx": "^1.34.0",
"@guiiai/logg": "^1.0.7",
"@proj-airi/server-sdk": "^0.1.4",
"@typeschema/zod": "^0.14.0",
"awilix": "^12.0.4",
"dotenv": "^16.4.7",
"es-toolkit": "^1.32.0",
"eventemitter3": "^5.0.1",
"minecraft-data": "^3.83.1",
"mineflayer": "^4.26.0",
"mineflayer-armor-manager": "^2.0.1",
"mineflayer-auto-eat": "^5.0.0",
"mineflayer-collectblock": "^1.6.0",
"mineflayer-pathfinder": "^2.4.5",
"mineflayer-pvp": "^1.3.2",
"mineflayer-tool": "^1.2.0",
"neuri": "^0.0.21",
"prismarine-block": "^1.21.0",
"prismarine-entity": "^2.5.0",
"prismarine-item": "^1.16.0",
"prismarine-recipe": "^1.3.1",
"prismarine-viewer": "^1.30.0",
"prismarine-windows": "^2.9.0",
"vec3": "^0.1.10",
"zod": "^3.24.1",
"zod-to-json-schema": "^3.24.1"
},
"devDependencies": {
"@antfu/eslint-config": "^4.1.1",
"eslint": "^9.19.0",
"lint-staged": "^15.4.3",
"simple-git-hooks": "^2.11.1",
"tsx": "^4.19.2",
"typescript": "^5.7.3",
"vitest": "^3.0.4"
}
}
+25
View File
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"target": "ESNext",
"lib": [
"ESNext"
],
"moduleDetection": "auto",
"module": "ESNext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"strict": true,
"strictNullChecks": true,
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"verbatimModuleSyntax": true,
"skipLibCheck": true
},
"include": [
"src/**/*.ts"
]
}
+7
View File
@@ -0,0 +1,7 @@
import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
include: ['src/**/*.test.ts'],
},
})