PrismarineJS/prismarine-viewer

Viewer not working

ChaCha20Poly1305 opened this issue · 5 comments

I installed mineflayer and mineflayerViewer with npm but the render is just completly broken. Node version 19.3.0
The Code:

const mineflayer = require('mineflayer')
const mineflayerViewer = require('prismarine-viewer').mineflayer

if (process.argv.length < 4 || process.argv.length > 6) {
console.log('Usage : node viewer.js [] []')
process.exit(1)
}

const bot = mineflayer.createBot({
host: process.argv[2],
port: parseInt(process.argv[3]),
username: process.argv[4] ? process.argv[4] : 'viewer',
// password: process.argv[5]
})

bot.once('spawn', () => {
mineflayerViewer(bot, { port: 3007, firstPerson: false })
bot.chat("/register lollollol lollollol");
bot.chat("/login lollollol");
})

This is the error:

PartialReadError: Read error for undefined : undefined
at new ExtendableError (/home/davpenguin/node_modules/protodef/src/utils.js:63:13)
at new PartialReadError (/home/davpenguin/node_modules/protodef/src/utils.js:70:5)
at Object.readBool [as bool] (/home/davpenguin/node_modules/protodef/src/datatypes/utils.js:133:41)
at Object.slot (eval at compile (/home/davpenguin/node_modules/protodef/src/compiler.js:258:12), :53:61)
at eval (eval at compile (/home/davpenguin/node_modules/protodef/src/compiler.js:258:12), :114:59)
at Object.particleData (eval at compile (/home/davpenguin/node_modules/protodef/src/compiler.js:258:12), :116:11)
at Object.packet_world_particles (eval at compile (/home/davpenguin/node_modules/protodef/src/compiler.js:258:12), :1152:63)
at eval (eval at compile (/home/davpenguin/node_modules/protodef/src/compiler.js:258:12), :2338:70)
at packet (eval at compile (/home/davpenguin/node_modules/protodef/src/compiler.js:258:12), :2412:9)
at CompiledProtodef.read (/home/davpenguin/node_modules/protodef/src/compiler.js:70:12)

2022-12-18-062859_1920x1080_scrot_002

This is same as #306

The solve is to set the version to the server version

It is one of the known bugs. The textures not loading because of the old version.

I choose v1.18.2 and it worked.
1.19.x is not yet added to the package

Fix (people aren't giving the full fix)

const bot = mineflayer.createBot({
  username: 'Bot',
  host: "",
  version: "1.18.2" // Or a valid version ( 1.19.+ isn't supported yet, use ViaVersion/ViaPlugins to fix )
})

Fixed issues: #330 #321(?)
image
( Yes that's my world, its in the sky, Also skins are bugged as I believe its bc my server is offline mode)