Projectile Damage Attribute [Fabric & Forge]

Projectile Damage Attribute [Fabric & Forge]

12M Downloads

[Bug] Projectile Attribute interference when running CraftTweaker attribute scripts with Property Modifier.

zaeonNineZero opened this issue ยท 7 comments

commented

After running the /reload command, the damage dealt by bows and crossbows held by the player increases by roughly 2 times. This factor changes slightly with each run of /reload, ranging from a roughly 2x boost to a near 6x boost (for ~50 damage per shot). Closing and reopening the world fixes it. Both the vanilla bow/crossbow and modded bows/crossbows are affected by this.

commented

Hello!
I am unable to reproduce this mod in any of my development or production environments.
This is most likely caused by another mod.

It would be greatly appreciated, if you could pinpoint which mod causes these symthomps.

commented

Bump, update please!

commented

With more testing, it seems that this problem is likely from using CraftTweaker to add the projectile damage attribute to the modded bows, without "add_default_attributes_for_unspecified_bows/crossbows" enabled. More specifically, the problem occurred when adding the attribute to the bows and crossbows added by Easy Steel, which release arrows at higher than normal velocity.

I need to do more testing to further isolate the issue, as it's possible that the root of the problem lies with one or both of those mods rather than with Projectile Damage Attribute.

commented

I did some further testing and isolated the problem down to a combination of CraftTweaker and Property Modifier as the main culprits. If I had to guess, Property Modifier is interfering with attribute refreshing when reloading the CraftTweaker script, thus messing up the damage without the attribute appearing to change.

commented

Here's an excerpt of the CraftTweaker script I was running when I found the issue. I also posted it in Property Modifier's issue tracker as well.
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>]);

commented

I think you need to specify a hardcoded UDID for the attribute modifier, otherwise it can be applied multiple times.

commented

That was exactly the problem, I copied the UUID from the Bow's default attribute and used that in my CT script and the issue went away. So this issue is now resolved.