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

recipesFor only recognizes oak_planks for crafting_table, ignores other plank variants #3549

Open
1 task done
windopper opened this issue Jan 9, 2025 · 0 comments
Open
1 task done
Labels
possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f

Comments

@windopper
Copy link

  • The FAQ doesn't contain a resolution to my issue

Versions

  • mineflayer: 4.23.0
  • server: paper-1.20.6-151
  • node: v22.12.0

Detailed description of a problem

When trying to craft a crafting table using different types of wooden planks, the recipe is only available for oak_planks. Using any other type of wooden planks (such as jungle_planks, spruce_planks, etc.) returns no recipe, despite this being possible in vanilla Minecraft. This seems to be a bug as all wooden planks should be able to craft a crafting table.

What did you try yet?

I tried using the recipesFor method to find recipes for crafting table. The method works correctly with oak_planks but returns an empty array when attempting to use other types of planks that are in the inventory.

Your current code

export const craftTest = async (bot: Bot) => {
    const mcData = minecraftData(bot.version);
    const itemType = mcData.itemsByName["crafting_table"];
    const recipe = bot.recipesFor(itemType.id, null, 1, null);

    // inventory list
    const inventory = bot.inventory.items();
    const inventory_list = convertItemsToString(inventory);
    console.log(inventory_list);

    if (recipe.length == 0) {
        return "No recipe found";
    }

    try {
        await bot.craft(recipe[0], 1);
        return "Successfully crafted the item";
    } catch (err) {
        return "Bot was unable to craft the item";
    }
}

Expected behavior

The recipesFor method should return valid crafting recipes for crafting table when using any type of wooden planks, not just oak_planks.

Additional context

@windopper windopper added possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f
Projects
None yet
Development

No branches or pull requests

1 participant