KubeJS

KubeJS

69M Downloads

Not Vanilla Attribute modify crash

MomoTechNet opened this issue · 2 comments

commented

Minecraft Version

1.18.2

KubeJS Version

1802.5.5-build.546

Rhino Version

1802.2.0-build.232

Architectury Version

4.7.78

Forge/Fabric Version

0.14.9

Describe your issue

mods:
dataattributes:data-attributes-1.1.12
playerex:playerex-3.2.7
relicex:relicex-3.1.4

//script.js

onEvent('item.registry.tool_tiers', event => {
event.add('legend', tier => {
tier.uses = 0.0
tier.speed = 4.0
tier.attackDamageBonus = 0.0
tier.level = 4
tier.enchantmentValue = 99
})})

onEvent('item.registry', event => {
event.create('hibikikatana', 'sword')
.tier('legend')
.glow(true)
.rarity("epic")
.attackDamageBaseline(10.0)
.speedBaseline(-2.4)
})

onEvent('item.modification' , event => {
event.modify(["kubejs:hibikikatana"], modification =>{
modification.addAttribute('minecraft:generic.movement_speed','2b413777-7140-451b-9774-481b9899e52a', "speed", 0.01, "addition")
modification.addAttribute('playerex:lifesteal','f33dd603-3e59-423d-9c9e-7cbd1444f59b', "x", 1 ,"addition")
})})

Thankfull! :D

Crash report/logs

https://paste.ubuntu.org.cn/4546611

commented

Urgh, I'm assuming the attribute doesn't yet exist by the time you're trying to modify the item?

commented

Its mean, those attributes isn't registry when the event running?

"java.lang.NullPointerException: Cannot invoke "Object.equals(Object)" because the return value of "java.util.Map$Entry.getKey()" is null"

That was a priorities problem?

I guess.