Currently the bot isn't able to drop into water, much less use a bucket to avoid fall damage. These would be nice features. I've somewhat successfully added an idea to my code but it fails for small bodies of water when falling from very high up as the bot seems to continue moving in the air and thus not fall on the predicted block.
To fix this, I think it would be a good idea to prevent lateral movement when attempting to fall into water.
This is what I have currently: (It's terrible but works as a proof of concept)
getLandingBlock(node, dir) {
let blockLand = this.getBlock(node, dir.x, -2, dir.z)
for (let i = 0; i < 100; i++) {
if (i < this.maxDropDown - 1) {
if (blockLand.physical || !blockLand.safe) break
blockLand = this.getBlock(node, dir.x, -2 - i, dir.z)
}
let possibleBlockLand = this.getBlock(node, dir.x, -2 - i, dir.z);
if (possibleBlockLand.liquid && possibleBlockLand.safe) {
blockLand = possibleBlockLand;
break;
}
}
return blockLand
}
I also had to change the if (!blockLand.physical) return checks in getMoveDropDown and getMoveDown to allow liquids. Are they even necessary if getLandingBlock returns only correct blocks anyway?
I'd make a pull request but this is nowhere near good enough yet.
Currently the bot isn't able to drop into water, much less use a bucket to avoid fall damage. These would be nice features. I've somewhat successfully added an idea to my code but it fails for small bodies of water when falling from very high up as the bot seems to continue moving in the air and thus not fall on the predicted block. To fix this, I think it would be a good idea to prevent lateral movement when attempting to fall into water. This is what I have currently: (It's terrible but works as a proof of concept)
I also had to change the
if (!blockLand.physical) return
checks ingetMoveDropDown
andgetMoveDown
to allow liquids. Are they even necessary ifgetLandingBlock
returns only correct blocks anyway?I'd make a pull request but this is nowhere near good enough yet.