nvb-uy / CIA

Other
2 stars 1 forks source link

UUIDs aren't included in the config by default #9

Closed Arena-Sniper closed 1 month ago

Arena-Sniper commented 2 months ago

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 https://github.com/nvb-uy/CIA/issues/1 happened.

Arena-Sniper commented 2 months ago

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

nvb-uy commented 2 months ago

I will do this soon ^^

Pandaismyname1 commented 1 month ago

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()
        ));
nvb-uy commented 1 month ago

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

nvb-uy commented 1 month ago

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