CraftTweaker

CraftTweaker

151M Downloads

addGlobalAttributeModifier not working

ereese99 opened this issue ยท 7 comments

commented

Issue description

Upon loading in I get this:
"No such member: addGlobalAttributeModifier"
"Scripts are invalid!"

Steps to reproduce

Put a line of code into my script.zs

Script used

tag:items:mythicmetals:aquarium_ingots.addGlobalAttributeModifier("845db27c-c624-495f-8c9f-6020a9a58b6b", "Armor modifier", 1, AttributeOperation.ADDITION, [constant:minecraft:equipmentslot:feet]);

The crafttweaker.log file

https://gist.github.com/ereese99/46f62cf146b897c098f6d297fd197a15

Minecraft version

1.19

Modloader

Fabric

Modloader version

0.14.17

CraftTweaker version

10.1.39

Other relevant information

No response

The latest.log file

https://gist.github.com/ereese99/fb42b54f09540569a415625190663f3a

commented
<tag:items:mythicmetals:aquarium_ingots>asIIngredient().addGlobalAttributeModifier("845db27c-c624-495f-8c9f-6020a9a58b6b", "Armor modifier", 1, AttributeOperation.ADDITION, [<constant:minecraft:equipmentslot:feet>]);

You need to do it like this

commented

Upload your script to pastebin, like the issue template asked for.

commented

Will try it now!

commented
<tag:items:mythicmetals:aquarium_ingots>.asIIngredient().addGlobalAttributeModifier("845db27c-c624-495f-8c9f-6020a9a58b6b", "Armor modifier", 1, AttributeOperation.ADDITION, [<constant:minecraft:equipmentslot:feet>]);

I made a typo, this one should work

commented

Working! Thanks!