Skip to content

Chunk size is xxx but only xxx was read #3594

Open
@IKorzI

Description

@IKorzI
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stage1just created by someone new to the project, we don't know yet if it deserves an implementation / a fpossible bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions