mineflayer icon indicating copy to clipboard operation
mineflayer copied to clipboard

Add bot.entityInSight() (recreation of #1371)

Open au5ton opened this issue 2 years ago • 5 comments

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.

au5ton avatar May 01 '22 22:05 au5ton

Dupe of https://github.com/PrismarineJS/mineflayer/pull/2077 ?

extremeheat avatar May 04 '22 20:05 extremeheat

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

extremeheat avatar May 04 '22 20:05 extremeheat

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.

au5ton avatar May 05 '22 04:05 au5ton

If you can make a test too, that would be great.

u9g avatar May 12 '22 19:05 u9g

This does not seem to test for obstructions. entityInSight() may return something even if a wall is in front of the bot.

extremeheat avatar Jun 05 '22 07:06 extremeheat

add test or example

rom1504 avatar Mar 04 '23 18:03 rom1504

please re-open if you want to finish it

rom1504 avatar Jul 29 '23 09:07 rom1504