Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ATF did not work #3

Closed
Hanwei233 opened this issue Jul 16, 2024 · 1 comment
Closed

ATF did not work #3

Hanwei233 opened this issue Jul 16, 2024 · 1 comment

Comments

@Hanwei233
Copy link

Hanwei233 commented Jul 16, 2024

Minecraft Version

1.20.1

Mod Version

2.0.1

Describe the bug!

I used kubejs to modify the weapon's attribute, but ATF didn't work, I think it's a bug
Video:

Minecraft.Forge_.1.20.1.-.Singleplayer.2024-07-17.03-36-58.mp4

My KJS codes:

ItemEvents.modification(event => {
    event.modify("minecraft:netherite_sword", item => {
        item.removeAttribute("minecraft:generic.attack_damage", UUID.fromString("cb3f55d3-645c-4f38-a497-9c13a33db5cf"))
        //item.removeAttribute("minecraft:generic.attack_speed", UUID.fromString("fa233e1c-4180-4865-b01b-bcce9785aca3"))
        item.addAttribute("minecraft:generic.attack_damage", UUID.fromString("cb3f55d3-645c-4f38-a497-9c13a33db5cf"), "Weapon modifier", 10, "addition")
        //item.addAttribute("minecraft:generic.attack_speed", UUID.fromString("fa233e1c-4180-4865-b01b-bcce9785aca3"), "Weapon modifier", -1, "addition")
    })
})

Crash Report

No response

Log

https://gist.github.com/hanweiyyds/8a3db9c70a4209287e53c5ad8640b479

Additions and Modifications

No

Additions and Modifications Description

No response

Did the issue happen in singleplayer or on a server?

Singleplayer

@LLytho
Copy link
Member

LLytho commented Jul 17, 2024

Thats because ATF does not handle changing the static attributes of items. I can't detect that people changing them. You have to use the correct UUID objects.

You can load https://github.com/AlmostReliable/attributetooltipfix/blob/1.20.1/Common/src/main/java/com/almostreliable/attributetooltipfix/ItemModifiers.java in kubejs and use the UUIDs there.

const ItemModifiers = Java.loadClass("com.almostreliable.attributetooltipfix.ItemModifiers")
// ItemModifiers.damage() or ItemModifiers.speed()
GitHub
A Minecraft mod to fix tooltip rendering for attributes when they are loaded through NBT. - AlmostReliable/attributetooltipfix

@LLytho LLytho closed this as completed Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants