mineflayer
mineflayer copied to clipboard
Add bot.entityInSight() (recreation of #1371)
This is a re-opening of https://github.com/PrismarineJS/mineflayer/pull/1371 after making the changes requested in: https://github.com/PrismarineJS/mineflayer/pull/1371#issuecomment-712040319
I would've used the original pull request, but the author's GitHub account was deleted, so I wasn't sure how to go about doing that.
This worked well for me in my limited testing.
Dupe of https://github.com/PrismarineJS/mineflayer/pull/2077 ?
This implementation seems cleaner with a width feature though. Making the name match the current block methods sounds like a good idea, like entityAtCursor()
in the other PR
This implementation seems cleaner with a width feature though. Making the name match the current block methods sounds like a good idea, like
entityAtCursor()
in the other PR
Are there any changes you'd like me to make, maybe specifically with the naming? I tried to follow the convention I saw in the other methods.
After looking at the other PR (#2077 ) it looks like I forgot to update the API docs, too.
If you can make a test too, that would be great.
This does not seem to test for obstructions. entityInSight() may return something even if a wall is in front of the bot.
add test or example
please re-open if you want to finish it