mojira.dev
MC-118740

Performing any right-click action silently resets the attack cooldown

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

MC-279583 Placing an offhand block resets weapon cooldown Resolved MC-279837 Attack cooldown is messed up. Resolved MC-271610 Unable to do critical hit with mace after the wind charge boost. Resolved MC-233025 Damage Cooldown Resolved MC-229442 Attack cooldown reset after the "use" function Resolved

Attachments

Comments 24

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.

Oh and still affects 1.12.1.

Added, but since you're the reporter of this bug you can update the affected versions directly.

Affects 1.16 pre release 2

14 more comments

Can confirm in 1.21.8

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.

this also happens when you place a block or dye a sheep in your offhand and then try to hit an entity do you know how annoying this is while playing bedwars?

migrated

(Unassigned)

Confirmed

Platform

Low

Combat

Minecraft 1.12, Minecraft 1.12.1, Minecraft 18w11a, Minecraft 18w14b, Minecraft 18w20a, , 1.20.6, 24w18a, 24w19a, 24w19b, 26.3 Snapshot 7

Retrieved