mojira.dev
MC-86252

Shields can continue to block after entity changes dimensions due to client and server desync

The bug

If the player is blocking when they change dimension via nether or end portal, they will continue to block attacks on the server side but will not be blocking client side.

How to reproduce

  1. Give the player a shield, and block with it:

    /give @s shield[minecraft:unbreakable={show_in_tooltip:true}]
  2. Setblock a nether or end portal:

    /setblock ~ ~ ~1 nether_portal
  3. Continuing to block with the shield, enter the portal

  4. Look north (for the sake of the next step)

  5. (In survival) Damage the player:

    /damage @p 3 minecraft:mob_attack at ~ ~ ~-2

Notes

  1. If the shield is in the off hand when you replicate this bug, you will be able to interact with your main hand in ways such as eating, attacking, and using other items

  2. This issue used to occur previously if the player opened a GUI durring the brief time that their shield was disabled, but that is since not reproducable as a change in an unknown version made it so that player can interact with GUI containers durring that time period.

Code analysis

Code analysis by @unknown can be found in this comment.

Linked issues

MC-88080 Shield - hitting and blocking at the same time Resolved MC-88386 Blocking mobs without actually blocking Resolved MC-88888 Shields will automatically block melee and ranged attacks from hostile mobs. Resolved MC-90994 Shield Nether Glitch Resolved MC-93461 Shield Glitch Resolved

Attachments

Comments 35

Logical_Cyclops

This bug is still existent in 15w51b, how is this still not fixed yet? It's been there ever since shields came out.

Confirmed for 16w06a

Brian McNamara

An easy way to set this up is to rig a dispenser filled with arrows to a tripwire hook (I've attached a screenshot). Just start blocking, then step through the tripwire while looking at the dispenser. Arrow fires, shield blocks it, dispenser GUI opens, then release the right mouse button. Now you're perma-blocking, but you can still sprint, swing your weapons, etc.

There is a bug very similar to this one that exists which makes your character block permanently until you die or reload the world. Even getting rid of the shield completely doesn't stop your character from blocking everything and basically being immortal. I don't know how to recreate that bug though, all I know is it's happened to me every single time in the final areas of my map.

I really hope they fix this bug soon as it's rather quite game breaking combat wise and the bugs have been there for ages and still exists in 1.9 itself.

Bug extant in 1.9.2

25 more comments

@unknown Do you mean MC-156600 by the shield not blocking visually?

Can't reproduce in 1.16-rc1

WitherSlayer5000

Can confirm

Requesting ownership of this issue to update information that is no longer accurate and maintain the issue as the original poster is inactive

Can confirm in 1.21.

Hatchling

[Mod] Jingy

rkullenius

Confirmed

Platform

Important

Player

blocking, desync, left-click, right-click, shield

Minecraft 15w33c, Minecraft 15w44b, Minecraft 15w51b, Minecraft 16w06a, Minecraft 1.9 Pre-Release 4, ..., 24w07a, 24w13a, 1.20.6, 24w19b, 1.21

24w33a

Retrieved