Skip to content

How can I use mineflayer-viewer in python? #2960

Answered by themg95
themg95 asked this question in Q&A
Discussion options

You must be logged in to vote

I asked this to bing AI and it gave me this working answer:

from javascript import require
mineflayer = require('mineflayer')
viewer = require('prismarine-viewer').mineflayer

bot = mineflayer.createBot({
  'host': 'localhost',
  'username': 'python'
})

@On(bot, 'spawn')
def onSpawn(*args):
  viewer(bot, { 'port': 3000 })

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@rogermiranda1000
Comment options

@NickKaluzhskikh
Comment options

Answer selected by themg95
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants