When having two items with attribute modifiers that have the same id and apply to the same attribute but require different slots to activate, the game starts behaving in unexpected ways.
Equipping both items in there respective slots only applies the modifier once (as expected.)
Removing only one of these items also removes the modifier despite the other item still being equipped in the correct slot and theoretically applying the modifier (unexpected).
I know that it is not intended to have two modifiers with the same id but it could actually be useful if this bug was fixed since it would then be possible to use an "or gate" for modifiers.
You either have to wear this equipment in this slot or this equipment in this other slot to get the modifier but wearing both at the same time doesn't add to your attribute value again. This has good implications for datapack creation in my opinion.
@Greymagic27
How to reproduce:
1. Use this command to give your self an item that applies a modifier when held in the mainhand:
/give @p turtle_scute[attribute_modifiers=[{id:"armor_id",type:"minecraft:armor",amount:1,operation:"add_value",slot:"mainhand"}]] 1
2. Use this command to give your self an item that applies a modifier with the same type and id but when on the players head:
/give @p golden_helmet[attribute_modifiers=[{id:"armor_id",type:"minecraft:armor",amount:1,operation:"add_value",slot:"head"}]] 1
3. Go into survival or adventure mode
4. Make sure you are not holding the turtle scute in your mainhand
5. Place the golden helmet on your head. You should now have one armor point.
6. Take the turtle scute in your mainhand. You should still have one armor point as excpected.
7. Scroll your hotbar so you are no longer holding the turtle scute.
What should happen: You should still have 1 armor point since the helmet is still on your head and should apply the modifier.
What actually happens: You will have 0 armor points since unselecting the turtle scute from your mainhand removed the modifier without checking for other items that should still apply it.
Linked issues
duplicates 1
Comments 2
Thank you for your report!
We're tracking this issue in MC-272769, 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
We do not have enough information to reproduce this issue.
Please include the following information to help us understand your problem:
Please also attach any needed commands, add-ons/behavior packs, data packs, resource packs, screenshots, videos, or worlds needed to help reproduce this issue.
Refer to the Bug Tracker Guidelines for more information about how to write helpful bug reports. Bug reports with insufficient information may be closed as Incomplete.
This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki