PrismarineJS / mineflayer

Create Minecraft bots with a powerful, stable, and high level JavaScript API.
https://prismarinejs.github.io/mineflayer/
MIT License
4.96k stars 904 forks source link

Fill Furnace Problem #833

Closed MrAlexEsisteGia closed 5 years ago

MrAlexEsisteGia commented 5 years ago

Versions

Detailed description of a problem

It callbacks saying that the furnace has no more space

Error: destination full at clickDest (C:\Users\ale54\Desktop\bot minecraft\node_modules\mineflayer\lib\plugins\inventory.js:217:16) at clickWindow (C:\Users\ale54\Desktop\bot minecraft\node_modules\mineflayer\lib\plugins\inventory.js:193:13) at Bot.bot.once (C:\Users\ale54\Desktop\bot minecraft\node_modules\mineflayer\lib\plugins\inventory.js:458:9) at Object.onceWrapper (events.js:277:13) at Bot.emit (events.js:189:13) at onAccepted (C:\Users\ale54\Desktop\bot minecraft\node_modules\mineflayer\lib\plugins\inventory.js:408:11) at confirmTransaction (C:\Users\ale54\Desktop\bot minecraft\node_modules\mineflayer\lib\plugins\inventory.js:398:7) at Client.bot._client.on (C:\Users\ale54\Desktop\bot minecraft\node_modules\mineflayer\lib\plugins\inventory.js:502:5) at Client.emit (events.js:189:13) at FullPacketParser.deserializer.on (C:\Users\ale54\Desktop\bot minecraft\node_modules\minecraft-protocol\src\client.js:82:12)

Current code

function riempifornoh () { //fillgrillh (yea, i have some amazing names for my functions)
  var blockfurnace = bot.findBlock({
    matching: [61],
    maxDistance: 4
  })
  if (blockfurnace) {
    var furnace = bot.openFurnace(blockfurnace)
    furnace.on('open', function () {
      if (!furnace.inputItem()) {
    var wood = bot.inventory.findInventoryItem(17)
      furnace.putInput(furnace, wood.type, null, 32, (err) => {
    if (err) {
      console.log(err) // usually says that the furnace is full WHEN IS NOT
    } else {
      console.log('1')//a really bad way to do error codes but i find it super efficient
    }
  })
  }
    })
  } else {
    console.log('niente furnaci pe mme')// no furnaces for mme  (italian)
  }
}

Expected behavior

Put 32 pieces of oak in the input slot of the furnace

Additional context

tried on vanilla and non

Reproduce

Execute the code when standing near a furnace(4 blocks min)

plexigras commented 5 years ago
furnace.putInput(furnace, wood.type, null, 32, (err) => {

shouldn't it be

furnace.putInput(wood.type, null, 32, (err) => {

https://github.com/PrismarineJS/mineflayer/blob/master/docs/api.md#furnaceputinputitemtype-metadata-count-cb