Skip to content
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

Call to 'collect' timed out. Increase the timeout by setting the timeout keyword argument. #3416

Open
1 task
spearsheep opened this issue Jul 11, 2024 · 0 comments
Labels
possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f

Comments

@spearsheep
Copy link

  • The FAQ doesn't contain a resolution to my issue

Versions

  • mineflayer: #.#.#
  • server: vanilla/spigot/paper #.#.#
  • node: #.#.#

Detailed description of a problem

Hi, I am just trying to collectBlock with the mineflayer-collectblock plugin. However, after 10 seconds an error occurs indicating that the Call to 'collect' timed out. I tried to adjust the timeout keyword but it didn't really work. Here is the error produced from my code:


Exception Traceback (most recent call last)
Cell In[8], line 1
----> 1 agent2.actions.mineBlock('spruce_fence',2)

File j:\multiagentCollaboration\actions.py:184, in Actions.mineBlock(self, name, count)
177 blocks = self.bot.findBlocks({
178 "matching": blockByName.id,
179 "maxDistance": 70,
180 "count": count,
181 'timeout': 1000,
182 })
183 targets = [self.bot.blockAt(block) for block in blocks]
--> 184 self.bot.collectBlock.collect(targets, {
185 'count': count,
186 'timeout': 1000,
187 'ignoreNoPath': True
188 })
189 self.bot.chat((f"I have finished mining {name}"))

File c:\Users\junyu\anaconda3\envs\Minecraft_env\Lib\site-packages\javascript\proxy.py:218, in Proxy.call(self, timeout, forceRefs, *args)
214 def call(self, *args, timeout=10, forceRefs=False):
215 mT, v = (
216 self._exe.initProp(self._pffid, self._pname, args)
217 if self._Is_class
...
139 )
140 res, barrier = self.loop.responses[callRespId]
141 del self.loop.responses[callRespId]

Exception: Call to 'collect' timed out. Increase the timeout by setting the timeout keyword argument.

Your current code ( I wrote in python)

/*
def mineBlock(self,name,count=1):
        blockByName = self.mcData.blocksByName[name]
        blocks = self.bot.findBlocks({
                    "matching": blockByName.id,
                    "maxDistance": 70,
                    "count": count,
                    'timeout': 1000,
                })
        targets = [self.bot.blockAt(block) for block in blocks]
        self.bot.collectBlock.collect(targets, {
                    'count': count,
                    'timeout': 1000,
                    'ignoreNoPath': True
                })
        self.bot.chat((f"I have finished mining {name}"))
*/

Expected behavior

I expect the agent to be able to collectBlock with longer timeout rather than just 10 seconds.

Additional context

Please help me with this issue, I don't know if this is an issue with mineflayer, the plugin, or JSPythonBridge

@spearsheep spearsheep added possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f labels Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f
Projects
None yet
Development

No branches or pull requests

1 participant