Closed flowl closed 3 years ago
Why could block.position possibly be null? I'm trying the following and don't understand why position is not set.
block.position
null
The bot is assured to be spawned.
// Somewhere after `bot.once('spawn', ())` const options = { matching: (block: Block) => { const isSign = /_sign$/.test(block.name) if (isSign) console.log(block) }, maxDistance: 24.0 } const results = bot.findBlock(options)
Prints for example:
Block { type: 166, metadata: 3, light: 0, skyLight: 0, biome: { id: 0, name: 'ocean', displayName: 'Ocean', rainfall: 0.5, temperature: 0.5 }, position: null, stateId: 3746, name: 'spruce_wall_sign', hardness: 1, displayName: 'Spruce Wall Sign', shapes: [], boundingBox: 'empty', transparent: true, diggable: true, material: 'wood', harvestTools: undefined, drops: [ 653 ] }
I'm using all most current stable versions.
The position of the entity is not set in the matcher function, but afterwards, at the end of findBlock when blockAt() is called.
findBlock
blockAt()
See https://github.com/PrismarineJS/mineflayer/blob/229ae9443e0f849cfbdb3dd1a896d475e6afd0b7/lib/plugins/blocks.js#L215
Indeed
Why could
block.position
possibly benull
? I'm trying the following and don't understand why position is not set.The bot is assured to be spawned.
Prints for example:
I'm using all most current stable versions.