PrismarineJS/prismarine-viewer

Unable to create mineflayer viewer with special arguments in Python #233

SpacePython12 posted onGitHub

When I try to initialize the mineflayer viewer through Python, it requires two arguments, the bot and the options. Since Python doesn't have a "primitive value type" (idk, I'm new to this), the class is returned as null. (Of course I used Viewer = require("prismarine-viewer").mineflayer.) I tried self.viewer = Viewer(self.bot, firstPerson=True), and self.viewer = Viewer(self.bot, {firstPerson: True}), and also self.viewer = Viewer(self.bot, "{ firstPerson: true }")

Am I missing something?


in python, dictionary keys must be put in quotation marks,

self.viewer = Viewer(self.bot, { 'firstPerson': True })

an example with mineflayer:

image

posted by extremeheat over 3 years ago

Awesome, thanks for the help!

posted by SpacePython12 over 3 years ago

Fund this Issue

$0.00
Funded

Pull requests