Custom Item Attributes (Modpack Utils Series)

Custom Item Attributes (Modpack Utils Series)

3M Downloads

UUIDs aren't included in the config by default

Arena-Sniper opened this issue ยท 5 comments

commented

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.

commented

I will do this soon ^^

commented

The solution is to add a UUID option, so players don't get conflicting attributes

commented

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()
        ));
commented

hm yeah that's a good idea! will implement this on the next version :)

commented

Fixed on 2.0.0, please read full changelog as the config moved locations and the format also changed.