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

Cannot find package 'mineflayer-web-inventory' imported from (On python) #35

Open
EvilGeorgee opened this issue Jan 14, 2023 · 4 comments

Comments

@EvilGeorgee
Copy link

EvilGeorgee commented Jan 14, 2023

web-inventory doesnt works on python
image

Requires in my code:
mineflayer = require('mineflayer')
pathfinder = require('mineflayer-pathfinder')
movements = require('mineflayer-pathfinder').Movements
GoalNear = require('mineflayer-pathfinder').goals
inventoryViewer = require('mineflayer-web-inventory')
pvp = require('mineflayer-pvp').plugin

@FanaticExplorer
Copy link

I downloaded it using npm, it started, wrote then it started in browser. However, after opening page of inventory, page is basically blank, but the site has his title!
So, it is still a problem.

@imharvol
Copy link
Owner

@FanaticExplorer Are you using python or just Javascript?

minecraft and mineflayer-web-inventory version?

@FanaticExplorer
Copy link

@FanaticExplorer Are you using python or just Javascript?
I'm using Python and python module "javascript" to access everyting mineflayer-related.

minecraft and mineflayer-web-inventory version?

Minecraft version is 1.19.2 and mineflayer-web-inventory version is the latest, 1.8.4. The version is specified in the options of bot.

Also, I tried to activate it using javascript.eval_js():

output = eval_js('''const inventoryViewer = require('mineflayer-web-inventory')
inventoryViewer(bot)''')

But, I'm getting error:

☕  JavaScript Error  Call to 'evaluateWithContext' failed:
> output = eval_js('''const inventoryViewer = require('mineflayer-web-inventory')
  at <module> (d:\Python\MinecraftBot\pathfinder.py:24)
> 

... across the bridge ...

  at Readable.push (node:internal/streams/readable:234:10)
  at readableAddChunk (node:internal/streams/readable:297:9)
  at addChunk (node:internal/streams/readable:324:12)
  at Socket.emit (node:events:513:28)
  at Socket.<anonymous> (D:\Python\MinecraftBot\.venv\Lib\site-packages\javascript\js\bridge.js:278:18)
  at Bridge.onMessage (D:\Python\MinecraftBot\.venv\Lib\site-packages\javascript\js\bridge.js:226:25)
  at Bridge.call (D:\Python\MinecraftBot\.venv\Lib\site-packages\javascript\js\bridge.js:136:42)
  at Object.evaluateWithContext (D:\Python\MinecraftBot\.venv\Lib\site-packages\javascript\js\bridge.js:70:24)
  at eval (eval at evaluateWithContext (D:\Python\MinecraftBot\.venv\Lib\site-packages\javascript\js\bridge.js:70:24), <anonymous>:2:24)
  at eval (eval at evaluateWithContext (D:\Python\MinecraftBot\.venv\Lib\site-packages\javascript\js\bridge.js:70:24), <anonymous>:2:1) 
  TypeError: inventoryViewer is not a function
> ^
🌉 TypeError: inventoryViewer is not a function

@FanaticExplorer
Copy link

@imharvol, updating info about python compatibility.

I succeed to install mineflayer-web-inventory using npm. Now, bot starts normally even without javascript.eval_js(). However, if I try to open inventory viewer, I can't see any item in bot inventory. Instead, I see this.
изображение
The inventory does not update if I give bot more items. The buttons “Show/Hide JSON” don't seem to work, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants