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

TypeError: Cannot mix BigInt and other types, use explicit conversions #3560

Open
1 task
vladbogun1 opened this issue Jan 15, 2025 · 0 comments
Open
1 task
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

@vladbogun1
Copy link

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

Versions

  • mineflayer: ^4.25.0
  • server: paper
  • node: 18

Detailed description of a problem

when my mineflayer bot spawns into Limbo, it crashes with error

/bot/node_modules/prismarine-chunk/src/pc/1.18/ChunkColumn.js:20
this.numSections = this.worldHeight >> 4
^
TypeError: Cannot mix BigInt and other types, use explicit conversions
at new ChunkColumn (/bot/node_modules/prismarine-chunk/src/pc/1.18/ChunkColumn.js:20:43)
at addColumn (/bot/node_modules/mineflayer/lib/plugins/blocks.js:53:16)
at Client. (/bot/node_modules/mineflayer/lib/plugins/blocks.js:296:5)
at Client.emit (node:events:517:28)
at emitPacket (/bot/node_modules/minecraft-protocol/src/client.js:84:12)
at FullPacketParser. (/bot/node_modules/minecraft-protocol/src/client.js:113:9)
at FullPacketParser.emit (node:events:517:28)
at addChunk (/bot/node_modules/readable-stream/lib/internal/streams/readable.js:323:12)
at readableAddChunk (/bot/node_modules/readable-stream/lib/internal/streams/readable.js:300:9)
at Readable.push (/bot/node_modules/readable-stream/lib/internal/streams/readable.js:246:10)

Your current code

 const mineflayer = require('mineflayer');
 
 const config = {
     host: '*****',
     port: 25565,
     username: '****@gmail.com',
     password: '*****',
     auth: 'microsoft',
     version: '1.21.3',
     loadInternalPlugins: true,
     viewDistance: 1,
 };
 
 let bot;
 
 function createBot() {
     bot = mineflayer.createBot(config);
 
     bot.on('spawn', () => {
         console.log('[BOT] Bot spawned and AFK now.');
         stayAFK();
     });
 
     bot.on('chat', (username, message) => {
         const logMessage = `[CHAT] ${username}: ${message}`;
         console.log(logMessage);
     });
 
     bot.on('error', (err) => {
         const errorMessage = `[BOT] Error encountered: ${err}`;
         console.error(errorMessage);
         setTimeout(createBot, 180000);
     });
 
     bot.on('end', () => {
         const disconnectMessage = '[BOT] Bot disconnected. Relogging...';
         console.log(disconnectMessage);
         setTimeout(createBot, 60000);
     });
 }
 
 function stayAFK() {
     setInterval(() => {
         const afkMessage = '[BOT] Bot AFK: OK.';
         console.log(afkMessage);
     }, 60000);
 }
 
 createBot();

Expected behavior

Bot works

@vladbogun1 vladbogun1 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 Jan 15, 2025
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

1 participant