The bug
When a player "uses" an item (or performs any other right-click action), the player is put into attack cooldown, as though the player had just attacked. On top of being unintended behavior, this cooldown is not visually indicated: the item in the main hand does not move down, and the attack indicator does not appear. Should the player attack right after a "use" action, the weapon will look like it's doing a normal attack, but will suffer all the penalties of being on cooldown, e.g. reduced damage, no sweeping hit, no crit.
How to reproduce
Put a sword in the main hand, a fishing rod in the offhand, and a mob in front of you. Use the rod, then immediately swing. There's no sweeping attack, and the mob will take less damage.
This bug interferes with common combat scenarios such as:
-Pulling a shield up to block just before attacking
-Placing blocks/water/lava from offhand then attacking
-Throwing a projectile from offhand then attacking
-Launching self with a wind charge before attacking
Linked issues
is duplicated by 11
relates to 5
Attachments
Comments 24
Relates to MC-116510.
Can confirm in 26.1. I want to add that when hitting a block with a sword in Adventure or Creative mode, the cooldown resets (as expected), but the attack indicator doesn’t show it.
This bug especially affects spears, since they cannot be used unless fully charged. Attacking too early after interacting with a block will swing the spear client-side, but won’t do any damage.
How does this duplicate switching weapons? This has nothing to do with switching what weapon a player is holding - using an item resets the cooldown. If you hold something in the offhand and right-click to use it, the main hand weapon has its cooldown activated.