mineflayer
mineflayer copied to clipboard
chest event 1.12.2
- [x] The FAQ doesn't contain a resolution to my issue
Versions
- mineflayer: 4.20
- server: vanilla/spigot/paper 1.12.2
- node: 18.18
Detailed description of a problem
the chest does not open in version 1.12.2. I tested it in version 1.8.8 and it opened
What did you try yet?
i try bot.openContainer, bot.openChest, bot.openBlock
Your current code
const mcData = require('minecraft-data')(bot.version)
const chestToOpen = bot.findBlock({
matching: ['chest', 'ender_chest', 'trapped_chest'].map(name => mcData.blocksByName[name].id),
maxDistance: 3
})
if (chestToOpen) {
bot.lookAt(chestToOpen.position).then(_ => {
bot.openBlock(chestToOpen).then((a) => {
console.log("chest", a);
}).catch(error => {
console.log("error", error);
});
})
}
Expected behavior
chest open
I have the same issue: #3360
I fixed my issue! Check it, maybe it works for you.