mojira.dev
MC-306132

Incorrect item use animations if animation is started before player is loaded

Steps to Reproduce:

  • Two players: A and B

  • Player A cannot see player B

  • Player B starts using a spyglass

  • Player A logs into the server / walks into render distance / etc. of player B

  • Player B’s hand animation will be wrong

Video

https://youtu.be/HP-Y066T2kc

Fix

This mixin fixes the issue. The explanation for why is left as an exercise to the reader.

@WrapOperation(method = "addPairing", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/level/ServerEntity;sendPairingData(Lnet/minecraft/server/level/ServerPlayer;Ljava/util/function/Consumer;)V"))
public void addPairing_sendPairingData(ServerEntity instance, ServerPlayer serverPlayer, Consumer<Packet<ClientGamePacketListener>> consumer, Operation<Void> original) {
    List<ClientboundSetEntityDataPacket> delayed = new ArrayList<>();

    instance.sendPairingData(serverPlayer, packet -> {
        if (packet instanceof ClientboundSetEntityDataPacket setEntityDataPacket) {
            delayed.add(setEntityDataPacket);
        } else {
            consumer.accept(packet);
        }
    });

    for (ClientboundSetEntityDataPacket setEntityDataPacket : delayed) {
        consumer.accept(setEntityDataPacket);
    }
}
@WrapOperation(method = "addPairing", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/level/ServerEntity;sendPairingData(Lnet/minecraft/server/level/ServerPlayer;Ljava/util/function/Consumer;)V"))
public void addPairing_sendPairingData(ServerEntity instance, ServerPlayer serverPlayer, Consumer<Packet<ClientGamePacketListener>> consumer, Operation<Void> original) {
    List<ClientboundSetEntityDataPacket> delayed = new ArrayList<>();

    instance.sendPairingData(serverPlayer, packet -> {
        if (packet instanceof ClientboundSetEntityDataPacket setEntityDataPacket) {
            delayed.add(setEntityDataPacket);
        } else {
            consumer.accept(packet);
        }
    });

    for (ClientboundSetEntityDataPacket setEntityDataPacket : delayed) {
        consumer.accept(setEntityDataPacket);
    }
}

Attachments

Comments 4

Was this recorded using the flashback mod? The tracker only takes reports from the unmodified vanilla game.

My other bug reports have been completely ignored so I don’t want to put any more effort into this than necessary. If someone wants to be pedantic and re-record it with both vanilla clients then feel free

Can confirm:

2026-02-01_20.21.25.png

Steps to Reproduce:

Start two Minecraft instances with Player A and Player B in the same world with cheats enabled.

Move the players so that they are out of each other's render distance:

Player A: /tp @s 0 100 0

Player B: /tp @s 10000 100 0

Log in as Player B and use the spyglass item.

Press the key to use the item to look through the spyglass, keeping it active by holding the key or using another method to keep the action active.

Switch to Player A's window.

Teleport to Player B's location.

Immediately look at Player B.

Observed Results:
The spyglass is being held by Player B at their side or in a "frozen" state, despite the fact that the item is active. The "aiming" animation is not being shown.

Expected Results:
The "aiming" animation should be shown by Player B as soon as they are loaded by Player A's client, with the spyglass being held up to their eye.




Reproduced in 26.1-snapshot-5 vanilla.

(The inventory thing I did to hold the spyglass whilst in my inventory is this: MC-306119 )

Moulberry

(Unassigned)

Unconfirmed

(Unassigned)

1.21.11

Retrieved