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

problem with 1.21.1 #3492

Open
1 task
BallisticOK opened this issue Oct 31, 2024 · 10 comments
Open
1 task

problem with 1.21.1 #3492

BallisticOK opened this issue Oct 31, 2024 · 10 comments
Labels
possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f

Comments

@BallisticOK
Copy link

  • The FAQ doesn't contain a resolution to my issue

Versions

  • mineflayer: 4.23.0
  • server: vanilla/spigot/paper paper 1.12.1
  • node: node.js 20

Detailed description of a problem

when trying to run the example code to learn about this im getting error the bot will join my server but flot there give me an error then just leave idk how i would fix then and the server is running local host

What did you try yet?

Did you try any method from the API?
Did you try any example? Any error from those?

Your current code

const mineflayer = require('mineflayer')

const bot = mineflayer.createBot({
  host: 'localhost', // minecraft server ip
  username: 'Bot', // username to join as if auth is `offline`, else a unique identifier for this account. Switch if you want to change accounts
  auth: 'microsoft' // for offline mode servers, you can set this to 'offline'
  // port: 25565,              // set if you need a port that isn't 25565
  // version: false,           // only set if you need a specific version or snapshot (ie: "1.8.9" or "1.16.5"), otherwise it's set automatically
  // password: '12345678'      // set if you want to use password-based auth (may be unreliable). If specified, the `username` must be an email
})

bot.on('chat', (username, message) => {
  if (username === bot.username) return
  bot.chat(message)
})

// Log errors and kick reasons:
bot.on('kicked', console.log)
bot.on('error', console.log)

Expected behavior

it should just join if im not mistaken and stay there till i make it do more

Additional context

here is the error im getting


RangeError: Read error for undefined : The value of "offset" is out of range. It must be >= 0 and <= 46944. Received -620568453
    at boundsError (node:internal/buffer:88:9)
    at Buffer.readUInt8 (node:internal/buffer:254:5)
    at Object.readVarInt [as varint] (/home/container/node_modules/protodef/src/datatypes/utils.js:68:22)
    at Object.string (eval at compile (/home/container/node_modules/protodef/src/compiler.js:262:12), <anonymous>:97:61)
    at eval (eval at compile (/home/container/node_modules/protodef/src/compiler.js:262:12), <anonymous>:3837:44)
    at eval (eval at compile (/home/container/node_modules/protodef/src/compiler.js:262:12), <anonymous>:3842:17)
    at eval (eval at compile (/home/container/node_modules/protodef/src/compiler.js:262:12), <anonymous>:3847:15)
    at eval (eval at compile (/home/container/node_modules/protodef/src/compiler.js:262:12), <anonymous>:3850:13)
    at eval (eval at compile (/home/container/node_modules/protodef/src/compiler.js:262:12), <anonymous>:3852:11)
    at Object.packet_advancements (eval at compile (/home/container/node_modules/protodef/src/compiler.js:262:12), <anonymous>:3857:9) {
  code: 'ERR_OUT_OF_RANGE',
  field: 'play.toClient'
}
An error occurred: ERR_OUT_OF_RANGE - Deserialization error for play.toClient : Read error for undefined : The value of "offset" is out of range. It must be >= 0 and <= 46944. Received -620568453 RangeError: Read error for undefined : The value of "offset" is out of range. It must be >= 0 and <= 46944. Received -620568453
    at boundsError (node:internal/buffer:88:9)
    at Buffer.readUInt8 (node:internal/buffer:254:5)
    at Object.readVarInt [as varint] (/home/container/node_modules/protodef/src/datatypes/utils.js:68:22)
    at Object.string (eval at compile (/home/container/node_modules/protodef/src/compiler.js:262:12), <anonymous>:97:61)
    at eval (eval at compile (/home/container/node_modules/protodef/src/compiler.js:262:12), <anonymous>:3837:44)
    at eval (eval at compile (/home/container/node_modules/protodef/src/compiler.js:262:12), <anonymous>:3842:17)
    at eval (eval at compile (/home/container/node_modules/protodef/src/compiler.js:262:12), <anonymous>:3847:15)
    at eval (eval at compile (/home/container/node_modules/protodef/src/compiler.js:262:12), <anonymous>:3850:13)
    at eval (eval at compile (/home/container/node_modules/protodef/src/compiler.js:262:12), <anonymous>:3852:11)
    at Object.packet_advancements (eval at compile (/home/container/node_modules/protodef/src/compiler.js:262:12), <anonymous>:3857:9) {
  code: 'ERR_OUT_OF_RANGE',
  field: 'play.toClient'
}

@BallisticOK BallisticOK added possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f labels Oct 31, 2024
@rom1504
Copy link
Member

rom1504 commented Oct 31, 2024 via email

@BallisticOK
Copy link
Author

paper

@BallisticOK
Copy link
Author

but i have since fixed this problem

@rom1504
Copy link
Member

rom1504 commented Nov 1, 2024 via email

@i240c
Copy link

i240c commented Nov 1, 2024

How did you fix it?

@mdmanl
Copy link

mdmanl commented Nov 2, 2024

Having this same issue, how did you fix it?

@rom1504
Copy link
Member

rom1504 commented Nov 2, 2024

@Lunarisyn104
Copy link

I have the same issue, are there any fixxes now?

@rom1504
Copy link
Member

rom1504 commented Nov 3, 2024

No please report any information you have (log, specific environment to reproduce) to help fix

@mdmanl
Copy link

mdmanl commented Nov 4, 2024

At this point it feels like I am absolutely chasing a ghost..
I can't replicate this error on a local server at all. Not with vanilla, not with paper, not with purpur, not with viaversion.

However, what I've noticed. One day the bot spits the following error, doesn't stay connected and doesn't respond to any commands:

RangeError [ERR_OUT_OF_RANGE]: Read error for undefined : The value of "offset" is out of range. It must be >= 0 and <= 103190. Received -199989011
    at new NodeError (node:internal/errors:399:5)
    at boundsError (node:internal/buffer:88:9)
    at Buffer.readUInt8 (node:internal/buffer:254:5)
    at Object.readVarInt [as varint] (\node_modules\protodef\src\datatypes\utils.js:68:22)
    at Object.string (eval at compile (\node_modules\protodef\src\compiler.js:262:12), <anonymous>:97:61)
    at eval (eval at compile (\node_modules\protodef\src\compiler.js:262:12), <anonymous>:3837:44)
    at eval (eval at compile (\node_modules\protodef\src\compiler.js:262:12), <anonymous>:3842:17)
    at eval (eval at compile (\node_modules\protodef\src\compiler.js:262:12), <anonymous>:3847:15)
    at eval (eval at compile (\node_modules\protodef\src\compiler.js:262:12), <anonymous>:3850:13)
    at eval (eval at compile (\node_modules\protodef\src\compiler.js:262:12), <anonymous>:3852:11) {
  code: 'ERR_OUT_OF_RANGE',
  field: 'play.toClient'
}
RangeError [ERR_OUT_OF_RANGE]: Read error for undefined : The value of "offset" is out of range. It must be >= 0 and <= 103190. Received -199989011
    at new NodeError (node:internal/errors:399:5)
    at boundsError (node:internal/buffer:88:9)
    at Buffer.readUInt8 (node:internal/buffer:254:5)
    at Object.readVarInt [as varint] (\node_modules\protodef\src\datatypes\utils.js:68:22)
    at Object.string (eval at compile (\node_modules\protodef\src\compiler.js:262:12), <anonymous>:97:61)
    at eval (eval at compile (\node_modules\protodef\src\compiler.js:262:12), <anonymous>:3837:44)
    at eval (eval at compile (\node_modules\protodef\src\compiler.js:262:12), <anonymous>:3842:17)
    at eval (eval at compile (\node_modules\protodef\src\compiler.js:262:12), <anonymous>:3847:15)
    at eval (eval at compile (\node_modules\protodef\src\compiler.js:262:12), <anonymous>:3850:13)
    at eval (eval at compile (\node_modules\protodef\src\compiler.js:262:12), <anonymous>:3852:11) {
  code: 'ERR_OUT_OF_RANGE',
  field: 'play.toClient'
}

The day after, it only spitted the following error, but stayed connected and just worked:

PartialReadError: Read error for undefined : Missing characters in string, found size is 103191 expected size was 1957790
    at new ExtendableError (\node_modules\protodef\src\utils.js:63:13)
    at new PartialReadError (\node_modules\protodef\src\utils.js:70:5)
    at Object.string (eval at compile (\node_modules\protodef\src\compiler.js:262:12), <anonymous>:100:15)
    at eval (eval at compile (\node_modules\protodef\src\compiler.js:262:12), <anonymous>:3837:44)
    at eval (eval at compile (\node_modules\protodef\src\compiler.js:262:12), <anonymous>:3842:17)
    at eval (eval at compile (\node_modules\protodef\src\compiler.js:262:12), <anonymous>:3847:15)
    at eval (eval at compile (\node_modules\protodef\src\compiler.js:262:12), <anonymous>:3850:13)
    at eval (eval at compile (\node_modules\protodef\src\compiler.js:262:12), <anonymous>:3852:11)
    at Object.packet_advancements (eval at compile (\node_modules\protodef\src\compiler.js:262:12), <anonymous>:3857:9)
    at eval (eval at compile (\node_modules\protodef\src\compiler.js:262:12), <anonymous>:4222:64)
Bot spawned

The day after that, it went to the behaviour like on the first day, not working. And today it's back to it's behaviour of the second day, only the 1 error and working again..

I'll ask the server owner for a full list of all the plugins, but at this moment it doesn't make any sense for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f
Projects
None yet
Development

No branches or pull requests

5 participants