If you have a custom enchantment, that say gives you extra health (or any other attribute), there are two weird bugs that I've found can occur:
The attribute only gets applied for one piece of armor
When taking off armor pieces, the attribute modifiers can be removed completely even while still wearing armor
See attached datapack.
How to recreate:
Go into a normal world with the installed datapack.
Get any two pieces of trimmable armor
Enchant them with their respective "health" enchantments found in the datapack
Put on both pieces of armor and observe how only one effect is applied
Remove one piece of armor and observe how no effects are applied
Linked issues
is duplicated by 2
Attachments
Comments 3
I can confirm the behavior described using the attached datapack in 24w19b. The attached datapack uses separate enchantments for each armor piece but the same UUID for all attribute modifiers. So this behavior is probably WAI.
related to MC-16466