NeoForge icon indicating copy to clipboard operation
NeoForge copied to clipboard

[1.20.5] ItemAttributeModifierEvent does not cover all uses of attributes

Open jaredlll08 opened this issue 9 months ago • 0 comments

(I'm listing 1.20.5 since that is my current environment, but I don't believe this has been changed in 1.20.6) Minecraft Version: 1.20.5

NeoForge Version: 20.5.0-beta

Description of issue:

CommonHooks#getAttributeModifiers is only called in ItemStack#forEachModifier, however there are other calls to DataComponents.ATTRIBUTE_MODIFIERS that do not use forEachModifier or that are covered by the ItemAttributeModifierEvent event, such as net.minecraft.advancements.critereon.ItemAttributeModifiersPredicate and net.minecraft.world.entity.Mob#getApproximateAttackDamageWithItem.

This leads to instances where attributes added via mods using the event are not seen in those methods.

jaredlll08 avatar May 02 '24 05:05 jaredlll08