Open SinanAkkoyun opened 3 years ago
In my case I saw that issue when bot is changing of target while is digging,
I think is a small issue of pathfinder
Oh thank you for the info! But it seems they even implemented a timeout for that, but somehow it apparently doesn't work
Correct, I wanted to say that the bug is inside pathfinder, maybe you can't fix from you code =P
Correct, I wanted to say that the bug is inside pathfinder, maybe you can't fix from you code =P
I know, I will take a look inside the pathfinder and maybe do a PR of I figure out how to do one
I mean I think the bug pies within mineflayer, because as far as I know the pathfinder does not execute "swing", just "dig"
Why was this closed? This is still an issue, or did it get fixed?
this is something in pathfinder not mineflayer open an issue there if it still affects you
no its not, pathfinder calls mineflayer's dig.
I wanted to say, I looked at the source and this issue is at the right place
ok, to be clear: this is not an issue with mineflayer. And probably also not with pathfinder. Do you have an example that reproduces the problem ?
It probably does not cancel the swingArm interval
I tried many codes.
Just take the provided collect block example and let it collect >60 blocks and it should be swinging afterwards. If it doesn't (but it does for me), try to send another collect command while the bot is trying to collect the old ones.
that sounds like a bug with collect block. do you mean https://github.com/PrismarineJS/mineflayer-collectblock/blob/master/examples/collector.js ?
Well no, as far as I understood it the collectblock plugin just calls the dig function of mineflayer which has the swing interval inside of it, which doesn't stop.
most likely dig is called several time without waiting for the previous one to finish that's a bug in collect bog / your code / pathfinder
we could try to protect against such bug in user code in mineflayer
you can try to move this line https://github.com/PrismarineJS/mineflayer/blob/88bbca227386e4bef378eecd954233fa2ee1f933/lib/plugins/digging.js#L96 to there https://github.com/PrismarineJS/mineflayer/blob/88bbca227386e4bef378eecd954233fa2ee1f933/lib/plugins/digging.js#L27
and try again
however if you don't provide any specific code example to reproduce the issue, there's not much we can do for you here
I will, thank you so much
can you try again now ?
I am studying atm, in 3 weeks I can
I've had the same problem: https://github.com/PrismarineJS/mineflayer/issues/1631
IMO, that bug is in the dig()
function.
When you switch from digging to something else too fast, the swing interval does never get cleared.
The problem occurs very quickly when you combine pathfinder and digging, because pathfinder itself sometimes digs a block too on its way.
There should be a ghettolock in the dig function because even with async programing, it's not possible to dig two blocks at the same time. You can ever only dig one block after the other.
There already is a "lock" but would be useful to add tests for it so we know if it needs fixing
Versions
Detailed description of a problem
When using the dig block, the bot often just keeps swinging its arm.
Happens in every example.