Open GoogleSites opened 5 years ago
Here's a video: https://youtu.be/TfIrl4GpYGQ
An easy way to fix this is to have the bot jump - it can make it over easily without sprinting.
Here's another path-finding issue (same type of thing): https://gyazo.com/8ecb5c78b2d921df898fd8d7b6ff48de
Indeed looks like a bug related to jumping in mineflayer. You can try to tweak jumping in mineflayer and tweak the way it's used in mineflayer-navigate
For mineflayer-navigate, do you mean this code block?
} else if (delta.y > -0.1) {
// possibly jump over a hole
gottaJump = 1.5 < horizontalDelta && horizontalDelta < 2.5;
}
bot.setControlState('jump', gottaJump);
Yes
I guess it doesn't jump for long enough
Kinda rough but this works. I'll clean it up later.
if (delta.y > 0.1) {
// gotta jump up when we're close enough
gottaJump = horizontalDelta < 1.75;
} else if (delta.y > -0.1) {
// possibly jump over a hole
gottaJump = 1.5 < horizontalDelta && horizontalDelta < 2.5;
} else if (Math.floor(nextPoint.y) === Math.floor(currentPosition.y - 1)) {
gottaJump = 1.5 < horizontalDelta && horizontalDelta <= 4;
}
bot.setControlState('jump', gottaJump);
better version:
if (delta.y > 0.1) {
// gotta jump up when we're close enough
gottaJump = horizontalDelta < 1.75;
} else if (delta.y > -0.1) {
// possibly jump over a hole
gottaJump = 1.5 < horizontalDelta && horizontalDelta < 2.5;
} else if (delta.y < -0.1) {
// possibly jump over a hole 1 block lower
gottaJump = 3 < horizontalDelta && horizontalDelta <= 4;
}
bot.setControlState('jump', gottaJump);
Bot keeps getting stuck in this type of scenario:
https://gyazo.com/f9f36242c761fc442da3247542517ab4
Make this and have the bot walk over it and it'll fall each time - doesn't even try to jump the gap.