global attribute modifications not working on fabric 1.21.1
Closed this issue ยท 1 comments
Issue description
crafttweaker says its applying the global modifications in the script, but it doesn't look like it's working? no indication of the extra attributes applying to the gear like adding hp, atk speed, etc. I'm not getting any errors from the crafttweaker logs.
Steps to reproduce
No response
Script used
The crafttweaker.log file
Minecraft version
1.21.1
Modloader
Fabric
Modloader version
0.16.9
CraftTweaker version
21.0.7
Other relevant information
Only mods i used while testing/encountering the bug
The latest.log file
In 1.21 the attribute system moved to being component based, and I forgot to remove those methods, I'm sorry that you wasted time trying them out.
This is the new method https://docs.blamejared.com/1.21.1/en/vanilla/api/item/ItemDefinition#addAttributeModifier
and this is how you can use it
<item:minecraft:golden_sword>.definition.addAttributeModifier(<attribute:minecraft:generic.attack_speed>, AttributeModifier.create(<resource:minecraft:golden_sword>, -2, <constant:minecraft:attribute/operation:add_value>), <constant:minecraft:equipmentslot/group:mainhand>);
I will be removing those old methods shortly