CraftTweaker

CraftTweaker

151M Downloads

global attribute modifications not working on fabric 1.21.1

Closed this issue ยท 1 comments

commented

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.
image
image

Steps to reproduce

No response

Script used

https://pastebin.com/tW31esDQ

The crafttweaker.log file

https://paste.bot.blamejared.com/136877912698650625/1253211465645686824/1304729620729434165/message.txt#L3415

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
image

The latest.log file

https://pastebin.com/kWru68fX

commented

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