Property Modifier

Property Modifier

2M Downloads

[Bug] Strange attribute interaction with CraftTweaker and Projectile Damage Attribute

zaeonNineZero opened this issue ยท 1 comments

commented

When using a CraftTweaker script to add the 'projectile_damage:generic' attribute from Projectile Damage Attribute as a global attribute modifier to any modded bows, then running the /reload command, the damage of all bows (including the vanilla bow, which is not affected by the script I ran) increases beyond the amount they should have given their attribute.

This issue only occurs when Property Modifier is installed with these two mods, as otherwise they function as intended.

Here is an excerpt from the script I'm running:
import crafttweaker.api.entity.attribute.AttributeOperation; import crafttweaker.api.entity.equipment.EquipmentSlot; <item:easy_steel:steel_bow>.anyDamage().addGlobalAttributeModifier(<attribute:projectile_damage:generic>, "Steel Bow", 5.4, AttributeOperation.ADDITION, [<constant:minecraft:equipmentslot:mainhand>,<constant:minecraft:equipmentslot:offhand>]);

I suspect that it may have something to do with modified attributes not clearing properly when running /reload under those circumstances, thus leading to a server-side increase in projectile damage without the attribute properly reflecting this on the client side.

Here's the issue I previously opened in the Projectile Damage Attribute repo:
ZsoltMolnarrr/ProjectileDamage#9

commented

Resolved the issue on the Projectile Damage Attribute issue. Turns out, probably due to how Property Modifier handles modifying attributes, the projectile damage attribute was being stacked on the server side. Adding a UUID matching that of the default Bow attribute allows the global attribute modifier to overwrite itself and prevent stacking.

You can use '/ct hand attributes' to get the UUID of the default attribute.

Hope this will help anyone who runs into this problem in the future!