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

Cannot Take Item out of Chest (Hangs on window.Withdraw) #3383

Closed
1 task done
Banana1059 opened this issue May 20, 2024 · 0 comments
Closed
1 task done

Cannot Take Item out of Chest (Hangs on window.Withdraw) #3383

Banana1059 opened this issue May 20, 2024 · 0 comments
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

@Banana1059
Copy link

Banana1059 commented May 20, 2024

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

Versions

  • mineflayer: 4.20.1
  • server: vanilla/spigot/paper: folia
  • node: 22.2.0

Detailed description of a problem

I'm trying to get it where my bot opens a chest and takes the first shulker box it finds. I'm able to get it to the chest and open it just fine, but cannot get it to take items from the chest as it just hangs at the chest.withdraw() line

What did you try yet?

I've tried window.withdraw and bot.moveSlotItem

Your current code

const chestBlock = bot.blockAt(new Vec3(x + offset, y, z));
        await bot.openContainer(chestBlock).then(async chest => {
            console.log(chest.slots)
            console.log(chest.slots.length)
            for (i = 0; i < chest.slots.length; i++) {
                if (!(chest.slots[i] === null)) {
                    if (chest.slots[i].name.includes('shulker_box')) {
                        shulker = chest.slots[i]
                    }
                }
            }
            if (!shulker) {
                kit_OutOfStock.push(kit);
                sendMessage(`/msg ${username} Kit Out Of Stock`);
                await chest.close();
                return;
            }
            console.log(shulker)
            await chest.withdraw(shulker.type, null, 1) //HANGS HERE
            await chest.close();
        });

Expected behavior

I except it to take a shulker out of the chest and then close the chest

Additional context

Each chest I test it on is full of exactly the same shulkers

@Banana1059 Banana1059 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 May 20, 2024
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