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

Error with mineflayer "Chunk size is 129 but only 1 was read ; partial packet " #22

Open
lonagi opened this issue May 22, 2022 · 7 comments

Comments

@lonagi
Copy link

lonagi commented May 22, 2022

const mineflayer = require('mineflayer')

const bot = mineflayer.createBot({
    host: IP, // minecraft server ip
    username: 'Trolololo',
    //password: '12345678' // minecraft password, comment out if you want to log into online-mode=false servers
    port: 25566,
    version: "1.18.2",
    // auth: 'mojang'              // only set if you need microsoft auth, then set this to 'microsoft'
})

var forgeHandshake = require('minecraft-protocol-forge').forgeHandshake
forgeHandshake(bot._client, {
    forgeMods: [
        { modid: 'feature_nbt_deadlock_be_gone', version: '2.0.0+1.18.2' },
        { modid: 'create', version: '0.4.1' },
        { modid: 'citadel', version: '1.11.3' },
        { modid: 'autoreglib', version: '1.7-53' },
        { modid: 'alexsmobs', version: '1.18.3' },
        { modid: 'flywheel', version: '1.18-0.6.2' },
        { modid: 'idas', version: '1.1.3+1.18.2' },
        { modid: 'quark', version: '3.2-356' },
        { modid: 'xaeroworldmap', version: '1.20.3.1' }
    ]
})

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)

Chunk size is 129 but only 1 was read ; partial packet : {"name":26}; buffer :1a7f7b227472616e736c617465223a22646973636f6e6e6563742e67656e65726963526561736f6e222c2277697468223a5b22496e7465726e616c20457863657074696f6e3a206a6176612e6c616e672e4e756d626572466f726d6174457863657074696f6e3a20466f7220696e70757420737472696e673a205c225c22225d7d

@devvilas
Copy link

Is this still opened? I'm having the same issue

var mc = require('minecraft-protocol')
var forgeHandshake = require('minecraft-protocol-forge').forgeHandshake;
const prompt = require('prompt-sync') ();
const ip = prompt('Host: ');
const s_ip = prompt('Port: ');


var client = mc.createClient({
	host: ip,
	port: s_ip,
	username: "Rcon",
});

forgeHandshake(client, {forgeMods: [
	{ modId: 'mcp', version: '1.18.2'},
	{ modId: 'FML', version: '40.1.51'},
	{ modId: 'Forge', version: '40.1.51'}
]})

Chunk size is 129 but only 1 was read ; partial packet : {"name":26}; buffer :1a7f7b227472616e736c617465223a22646973636f6e6e6563742e67656e65726963526561736f6e222c2277697468223a5b22496e7465726e616c20457863657074696f6e3a206a6176612e6c616e672e4e756d626572466f726d6174457863657074696f6e3a20466f7220696e70757420737472696e673a205c225c22225d7d

@lonagi
Copy link
Author

lonagi commented Jul 10, 2022

Is this still opened? I'm having the same issue

var mc = require('minecraft-protocol')
var forgeHandshake = require('minecraft-protocol-forge').forgeHandshake;
const prompt = require('prompt-sync') ();
const ip = prompt('Host: ');
const s_ip = prompt('Port: ');


var client = mc.createClient({
	host: ip,
	port: s_ip,
	username: "Rcon",
});

forgeHandshake(client, {forgeMods: [
	{ modId: 'mcp', version: '1.18.2'},
	{ modId: 'FML', version: '40.1.51'},
	{ modId: 'Forge', version: '40.1.51'}
]})

Chunk size is 129 but only 1 was read ; partial packet : {"name":26}; buffer :1a7f7b227472616e736c617465223a22646973636f6e6e6563742e67656e65726963526561736f6e222c2277697468223a5b22496e7465726e616c20457863657074696f6e3a206a6176612e6c616e672e4e756d626572466f726d6174457863657074696f6e3a20466f7220696e70757420737472696e673a205c225c22225d7d

Unfortunately, we need wait for code update from developers, because current versions Forge have another logic for handshakes, tcp...etc. 😭

@devvilas
Copy link

😭😭😭😭

@Felix-Jonathan
Copy link

Anybody found a solution ??

@Craftingkilla1
Copy link

still waiting for a solution... im getting the same error along with another right before on my first connection attempt:

const mc = require('minecraft-protocol');
const { forgeHandshake } = require('minecraft-protocol-forge');

const host = 'localhost';
const port = 25565; 
const username = 'Bot';
const maxRetries = 3;
let retries = 0;

function connectToServer() {
    const client = mc.createClient({
        host: host,
        port: port,
        username: username,
        version: false
    });

    forgeHandshake(client, {
        forgeMods: [
            { modid: 'offlineskins', version: '1.20.1-v1' },
            { modid: 'create', version: '1.20.1-0.5.1.f' },
            { modid: 'cupboard', version: '1.20.1-2.1'},
            { modid: 'connectivity', version: '1.20.1-4.8'}
        ]
    });

    client.on('connect', () => {
        console.log('Connected to the server!');
    });

    client.on('error', (err) => {
        console.log('Error:', err);
        if (err.code === 'ECONNRESET' && retries < maxRetries) {
            console.log(`Connection reset, retrying... (${++retries}/${maxRetries})`);
            setTimeout(connectToServer, 2000);
        }
    });

    client.on('end', () => {
        console.log('Disconnected from the server');
    });

    client.on('kick_disconnect', (reason) => {
        console.log('Kicked from the server:', reason);
    });
}

connectToServer();

Connected to the server!
Error: Error: read ECONNRESET
at TCP.onStreamRead (node:internal/stream_base_commons:217:20) {
errno: -4077,
code: 'ECONNRESET',
syscall: 'read'
}
Connection reset, retrying... (1/3)
Disconnected from the server
Connected to the server!
Chunk size is 129 but only 1 was read ; partial packet : {"name":26}; buffer :1a7f7b227472616e736c617465223a22646973636f6e6e6563742e67656e65726963526561736f6e222c2277697468223a5b22496e7465726e616c20457863657074696f6e3a206a6176612e6c616e672e4e756d626572466f726d6174457863657074696f6e3a20466f7220696e70757420737472696e673a205c225c22225d7d
Disconnected from the server

@ericlin11354
Copy link

Bump, I have this issue as well

@lluisd
Copy link

lluisd commented May 2, 2024

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants