Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-267934

Sending ClientboundTransferPacket followed by disconnect just kicks the player

XMLWordPrintable

    • Plausible
    • Networking
    • Important
    • Platform

      Description:

      Whole handling of TransferPacket (disconnecting from old and connecting to the new server) is scheduled as a client thread task. Doing simple thing as this (code below) will commonly just kick player and not transfer it.

      this.connection.send(new ClientboundTransferPacket(target.getHost(), target.getPort()));
      this.connection.disconnect(Component.literal("player sent"));

      What happens on the client side, I believe, is disconnect closes connection immediately and on the next game loop, PacketUtils::ensureRunningOnSameThread not handling the packet, because connection is already closed.

            dinnerbone [Mojang] Nathan Adams
            DreenDex Alexander
            Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: