mineflayer-pathfinder icon indicating copy to clipboard operation
mineflayer-pathfinder copied to clipboard

Pathfinder doesn't avoid lava

Open RJWadley opened this issue 3 years ago • 5 comments

Seems to me like the pathfinder gladly walks into lava as if it were ignoring it.

To recreate this, grab the basic GPS example from mineflayer, create a small lava lake, stand on the other side, and say come. Pathfinder walks straight through the lava lake rather than around.

RJWadley avatar Apr 10 '21 01:04 RJWadley

u mean movements.blocksToAvoid.add(BLOCK_ID) (this was a reply to something u9g said before he deleted ._.)

aesthetic0001 avatar Apr 10 '21 01:04 aesthetic0001

That could be a bug with the physic simulation. The path plan to jump over lava but the simulation find that it can swim and reach the other side. Could be useful to visualize with pviewer what the bot is thinking. Thanks for reporting.

Karang avatar Apr 10 '21 01:04 Karang

That seems consistent with what I'm seeing. There are some situations where it does try to avoid lava fine, such as flowing lava above-ground.

On a related note though, it will still accidentally touch the corner of flowing lava or fire since it's cutting the corner. To fix this the bot would need to take corners with lava/fire significantly wider than regular corners.

RJWadley avatar Apr 10 '21 01:04 RJWadley

#149 Not a perfect fix, but it shows where the problem is. It's not with pathfinding but with completing that path. With that fix it(almost always) jumps over lava correctly EDIT: it still doesn't correctly jump over 1-block-wide lava, tries to run over like on parkour but ofter fails due to lava damage

etiaro avatar May 05 '21 21:05 etiaro

There are some movements generated that violate the rules because they don't check all the blocks the bot will occupy. For example when a bot moves diagonally and down one block it does not check the final block for safety.

Here is a video demo: https://youtu.be/0xLNvio0cNA Here is the line for that specific issue. https://github.com/PrismarineJS/mineflayer-pathfinder/blob/c267bb2e1079fb515b886e3951f7e19230a0b64b/lib/movements.js#L285

SeanMcCord avatar May 25 '21 20:05 SeanMcCord