mojira.dev
MC-279412

Switching between items in the same tick as an attack can cause one item's attribute modifiers to be applied on another

What I expected to happen was...:
When hotkey-ing to an item in the same tick you attack, the attributes modifiers of the new item are applied and the new item (if applicable) would lose durability.

What actually happened was...:
When hotkey-ing to an item in the same tick you attack, the attribute modifiers of the old item (the one you switched from) are applied while the new item (if applicable) would lose durability and have its enchantments apply

Steps to Reproduce:
1. Go to survival
2. Take any item that can lose durability
3. Attack any entity, and, at the exact moment you attack, switch to an empty hotbar slot by using a hotkey

Attached are videos of me abusing this bug to do several things:
Attack with a diamond sword without losing durability
Use a netherite axe's attack damage attribute with a mace's breach and fire aspect enchantments to bypass armor while dealing the damage you'd expect from a netherite axe

I've also attached a .nbt file of the structure I used to test for anyone who wants to test it using my setup

Linked issues

Attachments

Comments 2

Thank you for your report!
We're tracking this issue in MC-28289, so this ticket is being resolved and linked as a duplicate.

If you would like to add a vote and any extra information to the main ticket it would be appreciated.

If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automatically! The ticket was resolved by one of our moderators, and I left this message to give more information to you.

MyShampooIsDrunk

(Unassigned)

Unconfirmed

(Unassigned)

1.21.4

Retrieved