Version
1.0.0 (Forge 1.18.2)
Describe the bug!
I'm attempting to modify the damage/speed attributes of a pickaxe, and I've had no avail so far. My desired result is having the Attack Damage be 4 and the Attack Speed be 1.4.
My code is the following (within a KubeJS script in the startup_scripts folder):
onEvent('item.modification', event => { event.modify('minecraft:wooden_pickaxe', item => { item.addAttribute("minecraft:generic.attack_damage", UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"), 'Tool modifier', 3, "addition") item.addAttribute("minecraft:generic.attack_speed", UUID.fromString("FA233E1C-4180-4865-B01B-BCCE9785ACA3"), 'Tool modifier', -2.6, "addition") }) })
And here is the ingame result:
I also tried changing my code to this: (i accidentally set the attack speed to -2.8 oops)
onEvent('item.modification', event => { event.modify('minecraft:wooden_pickaxe', item => { item.setAttackDamage(3) item.setAttackSpeed(-2.8) }) })
And here is the ingame result for that too:
My guess is that it may have to do with the fact that the attack damage/speed UUIDs from swords and axes are different from the attack damage/speed UUIDs from pickaxes, shovels, and hoes.
Crash Report
No response
Log
No response
Additional Context
Yes
Modifications
I have KubeJS installed, but nothing else on my mods list change KubeJS's behaviors in any way.
Did the issue happen in singleplayer or on a server?
Singleplayer