imharvol / mineflayer-web-inventory

Web based viewer for your mineflayer bot's inventory
MIT License
79 stars 19 forks source link

Item deposit failing #20

Closed constantins2001 closed 2 years ago

constantins2001 commented 3 years ago

When having mineflayer-web-inventory open in your browser, trying to deposit items to chests fails. I'd recommend fixing this as new mineflayer developers (like myself) will doubt their mental sanity after failing to copy an example multiple times :D

Code to reproduce: let chest = bot.blockAt(new Vec3(96, 80, 130)) bot.openChest(chest).then((inventory) => { inventory.deposit(621, null, 64).then(() => inventory.close()) })

Stacktrace:

    at clickDest (C:\Users\Constantin Schreiber\WebstormProjects\minecraft_storage_bot\node_modules\mineflayer\lib\plugins\inventory.js:223:51)
    at transferOne (C:\Users\Constantin Schreiber\WebstormProjects\minecraft_storage_bot\node_modules\mineflayer\lib\plugins\inventory.js:220:13)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async transfer (C:\Users\Constantin Schreiber\WebstormProjects\minecraft_storage_bot\node_modules\mineflayer\lib\plugins\inventory.js:203:5)
    at async C:\Users\Constantin Schreiber\WebstormProjects\minecraft_storage_bot\node_modules\mineflayer\lib\plugins\inventory.js:292:7
    at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
    at processPromiseRejections (internal/process/promises.js:247:11)
    at processTicksAndRejections (internal/process/task_queues.js:94:32)
(node:1756) TypeError: Cannot read property 'type' of null
    at clickDest (C:\Users\Constantin Schreiber\WebstormProjects\minecraft_storage_bot\node_modules\mineflayer\lib\plugins\inventory.js:223:51)
    at transferOne (C:\Users\Constantin Schreiber\WebstormProjects\minecraft_storage_bot\node_modules\mineflayer\lib\plugins\inventory.js:220:13)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async transfer (C:\Users\Constantin Schreiber\WebstormProjects\minecraft_storage_bot\node_modules\mineflayer\lib\plugins\inventory.js:203:5)
    at async C:\Users\Constantin Schreiber\WebstormProjects\minecraft_storage_bot\node_modules\mineflayer\lib\plugins\inventory.js:292:7
(node:1756) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    at emitDeprecationWarning (internal/process/promises.js:180:11)
    at processPromiseRejections (internal/process/promises.js:249:13)
    at processTicksAndRejections (internal/process/task_queues.js:94:32)
sefirosweb commented 3 years ago

Hi same issue here :D i have a topic related from a few months

imharvol commented 3 years ago

@sefirosweb @SaubereSache Can you try to recreate with mineflayer-web-inventory@1.5.0? I think I fixed it: https://github.com/imharvol/mineflayer-web-inventory/commit/c8773a0fd8f36106294bf41c89ea865e5ceb9525

Sorry for the late response

sefirosweb commented 3 years ago

Hi @imharvol I tryed to updated to latest version 1.6.0 and seems have an different issue,

Now i have an CORS error, I created a separate issue: https://github.com/imharvol/mineflayer-web-inventory/issues/24

sefirosweb commented 3 years ago

Hi @imharvol seems fixed the bug :D And now when chest is open, can see at real time moving items, this is great! Preview https://youtu.be/o0ChVtD4VL0