-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
blocksToAvoid doesnt work? #24
Comments
You added only iron_trapdoor, maybe you want to also add the other types of trapdoors (oak_trapdoor, spruce_trapdoor, birch_trapdoor, jungle_trapdoor, etc...) |
shouldnt he avoid that trapdoor? |
yes it should avoid it, I'll have a look |
my complete code regarding creating the bot:
|
It seems that the path goes above the trapdoor, but because the trapdoor is open, gravity makes the bot goes through it. There is a plan to fix that (and more generally all semi-solid blocks) but that is not done yet. It's not a bug with you code or with blocksToAvoid (if you add a block 2 blocks on top of the trapdoor, you'll see it doesn't go through it) but we need a function that tells us if a block is safe to walk on (and where). |
ummm soooo, is there a way for me to quick-fix this? |
A very hacky way to solve it would be to override the boundingBox property in mcData to be "empty" instead of "block" https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.15.2/blocks.json#L6315 that way the movement generator will know it can't walk on a trapdoor. You could also add some extra conditions here https://github.com/Karang/mineflayer-pathfinder/blob/master/lib/movements.js#L82 (the block.physical condition controls if the bot can walk on the block) |
I'll have a look if I can improve that. |
thanks :) |
so, it would be the same with cobwebs, i guess. |
cobwebs already have boundingBox="empty" so it should be ok. We already have a good description of the block shapes, I'm writing a function to use them properly. For instance, for the trapdoors, it is ok to jump on it, but only on a certain part of it. Having the block shape it is possible to compute the area on top of the block the bot is allowed to walk on. We should also be able to deduce if the bot can traverse the block in a certain direction. |
Should be fixed in the latest release. The bot can now stand on open trapdoors. |
Hello!
So, in my code, i have these lines:
var defaultMove = new Movements(this.botInstance, mcData);
defaultMove.blocksToAvoid.add(mcData.blocksByName.iron_trapdoor.id);
But the bot still just moves right through open trapdoors. (i use SetGoal(x,y,z))
Anyone have an idea, why?
Thanks!
PS: sorry for bad english
The text was updated successfully, but these errors were encountered: