PrismarineJS / mineflayer

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

findBlock issue with sapling / log #358

Closed arronmabrey closed 8 years ago

arronmabrey commented 8 years ago

Hey all,

I'm having an issue, where I can plant a sapling and let it grow into a full size tree e.g. log(s).

Using the findBlock function the bot can't find the log(s), however the bot can still see a sapling block, even though the sapling is fully grown now.

I found a way to force an update and that is to have the bot signout and sign back in. Then now I can use findBlock to detect the log blocks. This is obviously not a very workable solution.

Are you guys doing any kind of caching of blocks? Maybe the cache is not getting busted on the change?

Why would the bot not see the block change from sapling to a log?

Thanks, -- Arron

rom1504 commented 8 years ago

Hey, It might be related to https://github.com/PrismarineJS/mineflayer/issues/178 i.e. I'm not entirely sure if Multiblock updates are properly handled, I certainly didn't test much that feature.

Might be worth adding some console.log at https://github.com/PrismarineJS/mineflayer/blob/master/lib/plugins/blocks.js#L222 and see what happens when tree grows.

rom1504 commented 8 years ago

fixed by #364

arronmabrey commented 8 years ago

Awesome, I was just about to look into this. Thanks!

-- Arron