Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My Bot can not craft anything #164

Closed
ChunjiangMonkey opened this issue Jun 28, 2024 · 1 comment
Closed

My Bot can not craft anything #164

ChunjiangMonkey opened this issue Jun 28, 2024 · 1 comment

Comments

@ChunjiangMonkey
Copy link

Before submitting an issue, make sure you read the FAQ.md

Yes.

Briefly describe your issue

I am very excited to run voyager on my MacBook Pro. My robot can collect logs, however it can't make anything, just like planks.
looked at the code and found that when the Voyager runs craftItem.js, it gets stuck in the await bot.craft (recipe, count, craftingTable).

Please provide your python, nodejs, Minecraft, and Fabric versions here

python 3.9, node 20.14.0, Minecraft 1.19, Fabric 0.14.18.

[If applicable] Please provide the Minefalyer and Minecraft logs, you can find the log under logs folder

...

[If applicable] Please provide the GPT conversations that are printed each round.

This is the responses of GPT4, who privode the code for voyager to craft planks.
Action Agent ai message
Explain: The bot already has 6 oak logs in its inventory. It can craft these into planks, and then use the planks to craft a crafting table, which use craftItem().

Plan:

  1. Check if the bot has a crafting table in its inventory. If it does, the task is already complete.
  2. If the bot does not have a crafting table, check if it has 4 wooden planks in its inventory.
  3. If the bot does not have 4 wooden planks, craft them from the oak logs in its inventory.
  4. Once the bot has 4 wooden planks, craft a crafting table.

Code:

async function craftCraftingTable(bot) {
  // Check if the bot already has a crafting table
  const craftingTable = bot.inventory.findInventoryItem(mcData.itemsByName["crafting_table"].id);
  if (craftingTable) {
    bot.chat("Already have a crafting table.");
    return;
  }

  // Check if the bot has 4 wooden planks
  const planks = bot.inventory.findInventoryItem(mcData.itemsByName["oak_planks"].id);
  if (!planks || planks.count < 4) {
    // If not, craft them from the oak logs
    bot.chat("Crafting oak planks.");
    await craftItem(bot, "oak_planks", 1);
  }

  // Craft a crafting table
  bot.chat("Crafting crafting table.");
  await craftItem(bot, "crafting_table", 1);
  bot.chat("Crafting table crafted.");
}
@ChunjiangMonkey
Copy link
Author

I have solved this problem. The reason is that I used outdated version of mineflayer. In addition, I would like to remind everyone that Voyager may encounter the problem of skill not being able to write to the database on Windows. The solution is to upgrade the version of chromadb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant