PrismarineJS / mineflayer

Create Minecraft bots with a powerful, stable, and high level JavaScript API.
https://prismarinejs.github.io/mineflayer/
MIT License
4.96k stars 904 forks source link

Error: Attempted to read beyond the bounds of the managed data. #2911

Closed Jacob-Bootle closed 1 year ago

Jacob-Bootle commented 1 year ago

Versions

Detailed description of a problem

A clear and concise description of what the problem is, with as much context as possible. I know I could just hide the error but that isn't a proper solution

Error: Attempted to read beyond the bounds of the managed data. at SmartBuffer.ensureReadable (C:\Users\user\WebstormProjects\foragingbot\node_modules\smart-buffer\build\smartbuffer.js:1093:19) at SmartBuffer._readNumberValue (C:\Users\user\WebstormProjects\foragingbot\node_modules\smart-buffer\build\smartbuffer.js:1163:14) at SmartBuffer.readUInt32BE (C:\Users\user\WebstormProjects\foragingbot\node_modules\smart-buffer\build\smartbuffer.js:361:21) at BitArray.readBuffer (C:\Users\user\WebstormProjects\foragingbot\node_modules\prismarine-chunk\src\pc\common\BitArrayNoSpan.js:182:38) at DirectPaletteContainer.readBuffer (C:\Users\user\WebstormProjects\foragingbot\node_modules\prismarine-chunk\src\pc\common\PaletteContainer.js:30:15) at ChunkSection.read (C:\Users\user\WebstormProjects\foragingbot\node_modules\prismarine-chunk\src\pc\common\PaletteChunkSection.js:112:12) at ChunkColumn.load (C:\Users\user\WebstormProjects\foragingbot\node_modules\prismarine-chunk\src\pc\1.18\ChunkColumn.js:246:41) at addColumn (C:\Users\user\WebstormProjects\foragingbot\node_modules\mineflayer\lib\plugins\blocks.js:57:14) at Client. (C:\Users\user\WebstormProjects\foragingbot\node_modules\mineflayer\lib\plugins\blocks.js:272:5) at Client.emit (node:events:513:28) Ignoring block entities as chunk failed to load at -2 1

spams about 20 times in console

What are you building? What problem are you trying to solve? Simple bot to just join the server

What did you try yet?

Did you try any method from the API? No Did you try any example? Any error from those? No, but I assume it will have the same issue

Your current code


const mineflayer = require('mineflayer');

const bot = mineflayer.createBot({
    host: 'hypixel.net', // minecraft server ip
    username: '', // minecraft username
    password: '', // minecraft password, comment out if you want to log into online-mode=false servers
    auth: 'microsoft'
})

Expected behavior

Join the server with no errors

Additional context

Add any other context about the problem here.

Jacob-Bootle commented 1 year ago

RangeError: Invalid typed array length: Infinity at new Uint32Array () at new BitArray (C:\Users\user\WebstormProjects\foragingbot\node_modules\prismarine-chunk\src\pc\common\BitArrayNoSpan.js:16:17) at new DirectPaletteContainer (C:\Users\user\WebstormProjects\foragingbot\node_modules\prismarine-chunk\src\pc\common\PaletteContainer.js:8:17) at ChunkSection.read (C:\Users\user\WebstormProjects\foragingbot\node_modules\prismarine-chunk\src\pc\common\PaletteChunkSection.js:109:15)
at ChunkColumn.load (C:\Users\user\WebstormProjects\foragingbot\node_modules\prismarine-chunk\src\pc\1.18\ChunkColumn.js:246:41) at addColumn (C:\Users\user\WebstormProjects\foragingbot\node_modules\mineflayer\lib\plugins\blocks.js:57:14) at Client. (C:\Users\user\WebstormProjects\foragingbot\node_modules\mineflayer\lib\plugins\blocks.js:272:5) at Client.emit (node:events:513:28) at FullPacketParser. (C:\Users\user\WebstormProjects\foragingbot\node_modules\minecraft-protocol\src\client.js:91:12) at FullPacketParser.emit (node:events:513:28)

this error also comes up a couple of times, I assume its linked

SMEDjs commented 1 year ago

Same error , I tried multiple versions and it happens from 1.17 to 1.19+, on mc.hypixel.net, but not on my server (spigot 1.8.8) , it errors ~13 times

extremeheat commented 1 year ago

Known issue in prismarine-chunk for 1.8 - https://github.com/PrismarineJS/prismarine-chunk/issues/186

Dupe of https://github.com/PrismarineJS/mineflayer/issues/2614