![Custom Item Attributes (Modpack Utils Series)](https://media.forgecdn.net/avatars/thumbnails/937/793/256/256/638416345457799313.png)
UUIDs aren't included in the config by default
Arena-Sniper opened this issue ยท 5 comments
UUIDs are how Minecraft determines the IDs of attributes, if they have the same ID they will conflict with each other and only use the first attribute, this is likely how #1 happened.
The solution is to add a UUID option, so players don't get conflicting attributes
A simple fix would be to add the item name into the UUID generation, no extra config needed.
EntityAttribute attribute = generic_attribute.getAttribute();
Collection<EntityAttributeModifier> newModifiers = new ArrayList<>();
var identifierString = stack.toString() + generic_attribute.getString();
newModifiers.add(
new EntityAttributeModifier(
UUID.nameUUIDFromBytes(identifierString.getBytes()),
"Custom Item Attributes Modifier",
generic_attribute.getDouble(),
generic_attribute.getOperation()
));