[x] 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
Versions
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
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