Skip to content

Commit fb30fb8

Browse files
Merge pull request #614 from mindcraft-bots/develop
New Release
2 parents 1ca0f11 + cc16ecb commit fb30fb8

File tree

22 files changed

+765
-177
lines changed

22 files changed

+765
-177
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN apt-get -y install python3-boto3
1313
RUN apt-get -y install python3-tqdm
1414
RUN apt-get -y install tmux
1515

16-
RUN git clone https://github.com/kolbytn/mindcraft.git /mindcraft
16+
RUN git clone https://github.com/mindcraft-bots/mindcraft.git /mindcraft
1717
WORKDIR /mindcraft
1818
COPY ./server_data.zip /mindcraft
1919
RUN unzip server_data.zip
@@ -48,4 +48,4 @@ RUN ./aws/install
4848

4949
VOLUME /data
5050

51-
EXPOSE 8000
51+
EXPOSE 8000

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Crafting minds for Minecraft with LLMs and [Mineflayer!](https://prismarinejs.github.io/mineflayer/#/)
44

5-
[FAQ](https://github.com/kolbytn/mindcraft/blob/main/FAQ.md) | [Discord Support](https://discord.gg/mp73p35dzC) | [Video Tutorial](https://www.youtube.com/watch?v=gRotoL8P8D8) | [Blog Post](https://kolbynottingham.com/mindcraft/) | [Contributor TODO](https://github.com/users/kolbytn/projects/1) | [Paper Website](https://mindcraft-minecollab.github.io/index.html) | [MineCollab](https://github.com/kolbytn/mindcraft/blob/main/minecollab.md)
5+
[FAQ](https://github.com/mindcraft-bots/mindcraft/blob/main/FAQ.md) | [Discord Support](https://discord.gg/mp73p35dzC) | [Video Tutorial](https://www.youtube.com/watch?v=gRotoL8P8D8) | [Blog Post](https://kolbynottingham.com/mindcraft/) | [Contributor TODO](https://github.com/users/kolbytn/projects/1) | [Paper Website](https://mindcraft-minecollab.github.io/index.html) | [MineCollab](https://github.com/mindcraft-bots/mindcraft/blob/main/minecollab.md)
66

77

88
> [!Caution]
@@ -18,7 +18,7 @@ Do not connect this bot to public servers with coding enabled. This project allo
1818

1919
1. Make sure you have the requirements above.
2020

21-
2. Clone or download this repository (big green button) 'git clone https://github.com/kolbytn/mindcraft.git'
21+
2. Clone or download this repository (big green button) 'git clone https://github.com/mindcraft-bots/mindcraft.git'
2222

2323
3. Rename `keys.example.json` to `keys.json` and fill in your API keys (you only need one). The desired model is set in `andy.json` or other profiles. For other models refer to the table below.
2424

@@ -28,7 +28,7 @@ Do not connect this bot to public servers with coding enabled. This project allo
2828

2929
6. Run `node main.js` from the installed directory
3030

31-
If you encounter issues, check the [FAQ](https://github.com/kolbytn/mindcraft/blob/main/FAQ.md) or find support on [discord](https://discord.gg/mp73p35dzC). We are currently not very responsive to github issues. To run tasks please refer to [Minecollab Instructions](minecollab.md#installation)
31+
If you encounter issues, check the [FAQ](https://github.com/mindcraft-bots/mindcraft/blob/main/FAQ.md) or find support on [discord](https://discord.gg/mp73p35dzC). We are currently not very responsive to github issues. To run tasks please refer to [Minecollab Instructions](minecollab.md#installation)
3232

3333
## Tasks
3434

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"type": "module",
33
"dependencies": {
44
"@anthropic-ai/sdk": "^0.17.1",
5-
"@google/genai": "^1.15.0",
65
"@cerebras/cerebras_cloud_sdk": "^1.46.0",
6+
"@google/genai": "^1.15.0",
77
"@huggingface/inference": "^2.8.1",
88
"@mistralai/mistralai": "^1.1.0",
99
"canvas": "^3.1.0",
@@ -12,7 +12,7 @@
1212
"google-translate-api-x": "^10.7.1",
1313
"groq-sdk": "^0.15.0",
1414
"minecraft-data": "^3.97.0",
15-
"mineflayer": "^4.32.0",
15+
"mineflayer": "^4.33.0",
1616
"mineflayer-armor-manager": "^2.0.1",
1717
"mineflayer-auto-eat": "^3.3.6",
1818
"mineflayer-collectblock": "^1.4.1",

patches/mineflayer+4.32.0.patch

Lines changed: 0 additions & 14 deletions
This file was deleted.

patches/mineflayer+4.33.0.patch

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
diff --git a/node_modules/mineflayer/lib/plugins/digging.js b/node_modules/mineflayer/lib/plugins/digging.js
2+
index 496cf63..813a667 100644
3+
--- a/node_modules/mineflayer/lib/plugins/digging.js
4+
+++ b/node_modules/mineflayer/lib/plugins/digging.js
5+
@@ -242,11 +242,14 @@ function inject (bot) {
6+
enchantments = enchantments.concat(helmetEnchantments)
7+
}
8+
9+
+ if (block.material === 'incorrect_for_wooden_tool')
10+
+ block.material = 'mineable/pickaxe'
11+
+
12+
const creative = bot.game.gameMode === 'creative'
13+
return block.digTime(
14+
type,
15+
creative,
16+
- bot.entity.isInWater,
17+
+ false, // isInWater, water calc is bugged, so always false
18+
!bot.entity.onGround,
19+
enchantments,
20+
bot.entity.effects
21+
diff --git a/node_modules/mineflayer/lib/plugins/inventory.js b/node_modules/mineflayer/lib/plugins/inventory.js
22+
index 70db312..93d2054 100644
23+
--- a/node_modules/mineflayer/lib/plugins/inventory.js
24+
+++ b/node_modules/mineflayer/lib/plugins/inventory.js
25+
@@ -125,10 +125,15 @@ function inject (bot, { hideErrors }) {
26+
cursorZ: -1
27+
})
28+
} else if (bot.supportFeature('useItemWithOwnPacket')) {
29+
+ const yawDeg = -bot.entity.yaw * 180 / Math.PI + 180 // invert + shift
30+
+ const pitchDeg = -bot.entity.pitch * 180 / Math.PI // invert
31+
bot._client.write('use_item', {
32+
hand: offHand ? 1 : 0,
33+
sequence,
34+
- rotation: { x: 0, y: 0 }
35+
+ rotation: {
36+
+ x: yawDeg,
37+
+ y: pitchDeg
38+
+ }
39+
})
40+
}
41+
}
42+
diff --git a/node_modules/mineflayer/lib/plugins/place_block.js b/node_modules/mineflayer/lib/plugins/place_block.js
43+
index fdaec6b..08983b6 100644
44+
--- a/node_modules/mineflayer/lib/plugins/place_block.js
45+
+++ b/node_modules/mineflayer/lib/plugins/place_block.js
46+
@@ -11,7 +11,7 @@ function inject (bot) {
47+
let newBlock = bot.blockAt(dest)
48+
if (oldBlock.type === newBlock.type) {
49+
[oldBlock, newBlock] = await onceWithCleanup(bot, `blockUpdate:${dest}`, {
50+
- timeout: 5000,
51+
+ timeout: 500,
52+
// Condition to wait to receive block update actually changing the block type, in case the bot receives block updates with no changes
53+
// oldBlock and newBlock will both be null when the world unloads
54+
checkCondition: (oldBlock, newBlock) => !oldBlock || !newBlock || oldBlock.type !== newBlock.type

profiles/defaults/_default.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"cooldown": 3000,
33

4-
"conversing": "You are a playful Minecraft bot named $NAME that can converse with players, see, move, mine, build, and interact with the world by using commands.\n$SELF_PROMPT Act human-like as if you were a typical Minecraft player, rather than an AI. Be very brief in your responses, don't apologize constantly, don't give instructions or make lists unless asked, and don't refuse requests. Don't pretend to act, use commands immediately when requested. Do NOT say this: 'Sure, I've stopped.', instead say this: 'Sure, I'll stop. !stop'. Do NOT say this: 'On my way! Give me a moment.', instead say this: 'On my way! !goToPlayer(\"playername\", 3)'. Respond only as $NAME, never output '(FROM OTHER BOT)' or pretend to be someone else. If you have nothing to say or do, respond with an just a tab '\t'. This is extremely important to me, take a deep breath and have fun :)\nSummarized memory:'$MEMORY'\n$STATS\n$INVENTORY\n$COMMAND_DOCS\n$EXAMPLES\nConversation Begin:",
4+
"conversing": "You are an AI Minecraft bot named $NAME that can converse with players, see, move, mine, build, and interact with the world by using commands.\n$SELF_PROMPT Be a friendly, casual, effective, and efficient robot. Be very brief in your responses, don't apologize constantly, don't give instructions or make lists unless asked, and don't refuse requests. Don't pretend to act, use commands immediately when requested. Do NOT say this: 'Sure, I've stopped. *stops*', instead say this: 'Sure, I'll stop. !stop'. Respond only as $NAME, never output '(FROM OTHER BOT)' or pretend to be someone else. If you have nothing to say or do, respond with an just a tab '\t'. This is extremely important to me, take a deep breath and have fun :)\nSummarized memory:'$MEMORY'\n$STATS\n$INVENTORY\n$COMMAND_DOCS\n$EXAMPLES\nConversation Begin:",
55

66
"coding": "You are an intelligent mineflayer bot $NAME that plays minecraft by writing javascript codeblocks. Given the conversation, use the provided skills and world functions to write a js codeblock that controls the mineflayer bot ``` // using this syntax ```. The code will be executed and you will receive it's output. If an error occurs, write another codeblock and try to fix the problem. Be maximally efficient, creative, and correct. Be mindful of previous actions. Do not use commands !likeThis, only use codeblocks. The code is asynchronous and MUST USE AWAIT for all async function calls, and must contain at least one await. You have `Vec3`, `skills`, and `world` imported, and the mineflayer `bot` is given. Do not import other libraries. Do not use setTimeout or setInterval. Do not speak conversationally, only use codeblocks. Do any planning in comments. This is extremely important to me, think step-by-step, take a deep breath and good luck! \n$SELF_PROMPT\nSummarized memory:'$MEMORY'\n$STATS\n$INVENTORY\n$CODE_DOCS\n$EXAMPLES\nConversation:",
77

profiles/gemini.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "gemini",
33

4-
"model": "gemini-2.5-flash",
4+
"model": "gemini-2.5-pro",
55

66
"speak_model": "google/gemini-2.5-flash-preview-tts/Kore",
77

8-
"cooldown": 5000
8+
"cooldown": 2000
99
}

profiles/gpt.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"model": "gpt-5",
66
"params": {
77
"reasoning": {
8-
"effort": "minimal"
8+
"effort": "low"
99
}
1010
}
1111
}

src/agent/agent.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export class Agent {
6767
});
6868

6969
const spawnTimeout = setTimeout(() => {
70+
console.error('Bot has not spawned after 30 seconds. Exiting.');
7071
process.exit(0);
7172
}, 30000);
7273
this.bot.once('spawn', async () => {

src/agent/commands/actions.js

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ export const actionsList = [
301301
{
302302
name: '!placeHere',
303303
description: 'Place a given block in the current location. Do NOT use to build structures, only use for single blocks/torches.',
304-
params: {'type': { type: 'BlockName', description: 'The block type to place.' }},
304+
params: {'type': { type: 'BlockOrItemName', description: 'The block type to place.' }},
305305
perform: runAsAction(async (agent, type) => {
306306
let pos = agent.bot.entity.position;
307307
await skills.placeBlock(agent.bot, type, pos.x, pos.y, pos.z);
@@ -383,9 +383,29 @@ export const actionsList = [
383383
return 'Self-prompting stopped.';
384384
}
385385
},
386+
{
387+
name: '!showVillagerTrades',
388+
description: 'Show trades of a specified villager.',
389+
params: {'id': { type: 'int', description: 'The id number of the villager that you want to trade with.' }},
390+
perform: runAsAction(async (agent, id) => {
391+
await skills.showVillagerTrades(agent.bot, id);
392+
})
393+
},
394+
{
395+
name: '!tradeWithVillager',
396+
description: 'Trade with a specified villager.',
397+
params: {
398+
'id': { type: 'int', description: 'The id number of the villager that you want to trade with.' },
399+
'index': { type: 'int', description: 'The index of the trade you want executed (1-indexed).', domain: [1, Number.MAX_SAFE_INTEGER] },
400+
'count': { type: 'int', description: 'How many times that trade should be executed.', domain: [1, Number.MAX_SAFE_INTEGER] },
401+
},
402+
perform: runAsAction(async (agent, id, index, count) => {
403+
await skills.tradeWithVillager(agent.bot, id, index, count);
404+
})
405+
},
386406
{
387407
name: '!startConversation',
388-
description: 'Start a conversation with a player. Use for bots only.',
408+
description: 'Start a conversation with a bot. (FOR OTHER BOTS ONLY)',
389409
params: {
390410
'player_name': { type: 'string', description: 'The name of the player to send the message to.' },
391411
'message': { type: 'string', description: 'The message to send.' },
@@ -402,7 +422,7 @@ export const actionsList = [
402422
},
403423
{
404424
name: '!endConversation',
405-
description: 'End the conversation with the given player.',
425+
description: 'End the conversation with the given bot. (FOR OTHER BOTS ONLY)',
406426
params: {
407427
'player_name': { type: 'string', description: 'The name of the player to end the conversation with.' }
408428
},

0 commit comments

Comments
 (0)