Skip to content

Cancelled interact event should not send a swing packet. #14375

Open

Description

@Xiao-MoMi

Observed/Actual behavior

Other players receive an incorrect hand-swing packet

Paper version

26.3-175

Other

I noticed that a check for the result of the interaction event seems to be missing here, which might be helpful for the fix
ServerGamePacketListenerImpl.java line 1222

- } else if (result instanceof InteractionResult.Success success && success.shouldSwing()) {
+ } else if (result instanceof InteractionResult.Success success
+         && success.shouldSwing()
+         && !this.player.gameMode.interactResult) {
      this.player.swingAndResetAttackStrength(
          hand,
          interactAnimation,
          success.swingSource() != InteractionResult.SwingSource.PREDICTED
      );
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Fields

    MC Issue

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions