-
-
Notifications
You must be signed in to change notification settings - Fork 941
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
bot.trade()
hangs forever
#2681
Comments
Do you managed to resolved it ? I am stuck here too.. |
@tyjtyj nope, i haven't looked at it in a while. There seem to be a few places in the code base that have unresolved promises or errors. I think my best workaround was to have a 60-second time out on each "action" and start the beginning if the timeout wasn't cleared. I also have to make all my actions as idempotent as possible. |
This is temporary works for me. The traded item drop on the floor but it go pick up itself. Rather than random hung this works for now
Seems everything hung after this .. only closing the windows works. Sorry for mess up code. |
Having the same issue. Sometimes it works after restarting the bot, but most of the time the window stays open indefinitely. |
@wmantly The workaround you posted fixed the issue. Thanks! |
If you know the problem, feel free to open a PR |
Versions
Detailed description of a problem
When calling
bot.trade
sometimes it will just hang. I have tracked the issue to this line: https://github.com/PrismarineJS/mineflayer/blob/master/lib/plugins/villager.js#L165The last time
updateSlot
is called,countOfItemOneLeftToTake
is not zero.upateSlots
never gets called again and the whole app hangs.What did you try yet?
I have edited the function in question to find, and midagte the issue. It still hangs.
returns the following out, and just hangs forever
Did you try any method from the API?
Did you try any example? Any error from those?
Your current code
Expected behavior
For it not to hang...
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: