Summary:
When switching from holding one item (e.g. an iron sword) to holding another item of the same type (e.g. another iron sword), the attack speed indicator does not get reset. This is presumably intended behaviour.
However, this behaviour does not take into account the edge case of switching between two items that are of the same type but have different attack speeds. For instance, if a player has a default iron sword as well as a custom iron sword with a slower attack speed, switching from the default sword to the custom sword will not reset the attack bar.
Steps to Reproduce:
1) Ensure that the attack indicator is enabled in the video settings.
2) Obtain a normal iron sword and place it in your hotbar.
3) Run this command to obtain an iron sword with a modified attack speed of -3.9:
give @s iron_sword[attribute_modifiers=[{id:"generic_attack_speed",type:"attack_speed",amount:-3.9,operation:"add_value",slot:"mainhand"}]] 14) Hit something using the default sword and wait for approximately five seconds.
5) Now, switch to holding the custom sword.
6) Divert your gaze to the attack indicator next to your crosshair or hotbar. You will see that the attack indicator will already be half full, despite having only just switched to the item you are holding.
The expected behaviour would be for the attack speed cooldown to be reset upon switching to an item with a different attack speed, regardless of whether or not the two items are of the same type.
Linked issues
is duplicated by 1
Comments 4
I would personally not want this fixed. Currently, you’re rewarded for using two items of the same type (such as a Sharpness diamond sword and a Smite diamond sword) by being able to freely switch between the two without triggering the attack cooldown. Carrying two of the same weapon is already niche and the attack speed behavior was one of its only redeeming qualities.
This behavior also allows for effective duel wielding (one weapon in the offhand and one in the mainhand, and freely switching between the two using F without reseting cooldown).
Confirmed in 1.20.3 pre 1