mineflayer icon indicating copy to clipboard operation
mineflayer copied to clipboard

chest event 1.12.2

Open SnowRunescape opened this issue 1 year ago • 2 comments

  • [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?

image

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

SnowRunescape avatar Mar 27 '24 02:03 SnowRunescape

I have the same issue: #3360

chiteroman avatar Apr 26 '24 10:04 chiteroman

I fixed my issue! Check it, maybe it works for you.

chiteroman avatar Apr 26 '24 22:04 chiteroman