#How to modify armour stats?

10 messages · Page 1 of 1 (latest)

mental yarrow
#

I have some mods and the stats some items give are unbalanced so I'm trying KubeJS, some JS knowledge but none with minecraft code.

visual sandBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

mental yarrow
#

I tried this but it didn't work

onEvent('item.modification', event=>{
    event.modify('mod:item', item=>{
        item.armorProtection-=1;
        item.armorToughness-=1;
    })
})
unborn void
#

you can't do math expressions on something like that

#

you need to set it

mental yarrow
#

this also didn't work

onEvent('item.modification', event=>{
    event.modify('minecraft:leather_boots', item=>{
        item.setArmorProtection(20);
    })
})
#

in this file kubejs/startup_scripts/script.js

unborn void
mental yarrow
#

this also did't work (full /kubejs/startup_scripts/script.js file)

// priority: 0

console.info('Hello, World! (You will only see this line once in console, during startup)')

onEvent('item.modification', event=>{
        event.modify('minecraft:leather_boots', item=>{
                item.armorProtection=20;
        })
})
visual sandBOT
#

@mental yarrow Unresolved thread still hasn't been closed! If your question was answered, please close this post with </ticket close:1054771505520717835> command!