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

Chunk size is xxx but only xxx was read #3594

Open
1 task done
IKorzI opened this issue Feb 24, 2025 · 4 comments
Open
1 task done

Chunk size is xxx but only xxx was read #3594

IKorzI opened this issue Feb 24, 2025 · 4 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

@IKorzI
Copy link

IKorzI commented Feb 24, 2025

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

Versions

  • mineflayer: 4.26.0
  • server: vanilla 1.20.5 - 1.21.4
  • node: 22.11.0

Detailed description of a problem

When loading the world, the bot is kicked from the server.
In the console before the kick, many messages with the same beginning are displayed: Chunk size is xxx but only xxx was read.
An example is shown in the video at the link: https://youtu.be/VvE6A17yMBA
The video shows that after selecting the mode, the bot is kicked.
The reason for the kick is as follows (received via bot.on("kicked")):

{
    "type": "compound",
    "value": {
        "extra": {
            "type": "list",
            "value": {
                "type": "compound",
                "value": [
                    {
                        "text": {
                            "type": "string",
                            "value": "DecoderException : ru.Keksik9000.ClearFilter.exceptions.FastException: No more bytes reading varint @ io.netty.handler.codec.MessageToMessageDecoder:98"
                        }
                    }
                ]
            }
        },
        "text": {
            "type": "string",
            "value": ""
        }
    }
}

What did you try yet?

I used methods from the API.
bot.on("windowOpen"), bot.on("kicked"), bot.on("end"), bot.activateItem(), bot.moveSlotItem(sourceSlot, destSlot).

Your current code

Handling kick from server

    this.bot.on("kicked", (reason, loggedIn) => {
      console.log(`[${this.username}]: Причина:`);
      console.log(reason);
      console.log(`[${this.username}]: loggedIn:\n${loggedIn}`);
    });

    this.bot.on("end", (reason) => {
      console.log(`[${this.username}]: Аккаунт отключен от сервера по причине:\n${reason}`);
      account.list[this.username].connected = false
      rendering_window.show(false);
      account.selected_account.rendering = false
      fast_action_buttons.setConnect(false)
      delete bots[this.username]
    });

Expected behavior

The bot should not leave the server
The following behavior is expected (version 1.20.1 used): https://youtu.be/u-wS1772FAo

Additional context

I tried changing the version and the newest version on which everything works is 1.20.4. On versions from 1.20.5 to 1.21.4 the bot is kicked.

@IKorzI IKorzI 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 Feb 24, 2025
@rom1504
Copy link
Member

rom1504 commented Feb 24, 2025 via email

@IKorzI
Copy link
Author

IKorzI commented Feb 25, 2025

Here is a minimal example that reproduces the crash:

const mineflayer = require('mineflayer');

const bot = mineflayer.createBot({
  host: "mc.dexland.org",
  port: "25565",
  version: "1.21.4",
  username: "zherebec352"
})

bot.on('spawn', () => {
  setTimeout(() => {
    bot.setQuickBarSlot(0);
    bot.activateItem();
    console.log("Item activated");
  }, 500);
});

bot.on('windowOpen', (window) => {
  setTimeout(() => {
    bot.moveSlotItem(9, 45);
    console.log("Slot moved");
  }, 500);
});

bot.on("kicked", (reason, loggedIn) => {
  console.log("reason:");
  console.log(reason);
  console.log("loggedIn:");
  console.log(loggedIn);
});

bot.on("end", (reason) => {
  console.log("I'm finished");
  console.log(reason);
});

Before launching, you need to log into the server from a regular Minecraft client and register.:

/reg <password> <password>

Or log in:

/l <password>

@therepower
Copy link

i am having the same issue. Did you find a way to fix it yet?

@IKorzI
Copy link
Author

IKorzI commented Mar 8, 2025

No, I haven't found a solution to this problem.
This problem existed before but it was fixed in mineflayer. As far as I understand, this problem exists now because mineflayer switched to Minecraft 1.21.4 relatively recently. I think this problem will be solved soon.

The only thing I know is that you can run the bot on an earlier version (for example, on version 1.20.1), where this problem was solved.

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

3 participants