mojira.dev
MC-267934

Sending ClientboundTransferPacket followed by disconnect just kicks the player

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.

Linked issues

Comments 0

No comments.

Alexander

Nathan Adams

Plausible

Platform

Important

Networking

packet, thread, transfer

24w03a, 24w03b, 24w04a, 24w05a, 24w05b, 24w06a, 24w07a, 24w09a, 24w13a

1.20.5 Pre-Release 1

Retrieved