#Editing armor properties

43 messages · Page 1 of 1 (latest)

proud bobcat
#

I'm trying to edit some armor base defense for my modpack, but it doesnt seems to work:

onEvent("item.modification", event => {
// Wandering Magician Armor
event.modify("irons_spellbooks:wandering_magician_helmet", item => {
item.armorProtection = 2;
});
event.modify("irons_spellbooks:wandering_magician_chestplate", item => {
item.armorProtection = 5;
});
event.modify("irons_spellbooks:wandering_magician_leggings", item => {
item.armorProtection = 3;
});
event.modify("irons_spellbooks:wandering_magician_boots", item => {
item.armorProtection = 1;
});
// Pumpkin Armor
event.modify("irons_spellbooks:pumpkin_helmet", item => {
item.armorProtection = 2;
});
event.modify("irons_spellbooks:pumpkin_chestplate", item => {
item.armorProtection = 5;
});
event.modify("irons_spellbooks:pumpkin_leggings", item => {
item.armorProtection = 3;
});
event.modify("irons_spellbooks:pumpkin_boots", item => {
item.armorProtection = 1;
});
});

OnEvent dont work anymore, and I dont know what to replace for this to work

Property Modifier mod doesnt work for this mod
And I've already read the wiki, and found nothing that helped me

brisk wolfBOT
#

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

livid frigate
#

ItemEvents.modification(event => {})

proud bobcat
#

do I need to reset the world for it to work?

#

ItemEvents.modification(event => {
event.modify('irons_spellbooks:wandering_magician_helmet', item => {
item.armorProtection = 2;
});

event.modify('irons_spellbooks:wandering_magician_chestplate', item => {
    item.armorProtection = 5;
});

event.modify('irons_spellbooks:wandering_magician_leggings', item => {
    item.armorProtection = 3;
});

event.modify('irons_spellbooks:wandering_magician_boots', item => {
    item.armorProtection = 1;
});

event.modify('irons_spellbooks:pumpkin_helmet', item => {
    item.armorProtection = 2;
});

event.modify('irons_spellbooks:pumpkin_chestplate', item => {
    item.armorProtection = 5;
});

event.modify('irons_spellbooks:pumpkin_leggings', item => {
    item.armorProtection = 3;
});

event.modify('irons_spellbooks:pumpkin_boots', item => {
    item.armorProtection = 1;
})

})

#

doesnt seems to work

#

the game stopped crashing, but values of armors doesnt change

livid frigate
#

I dont remember the exact syntax

proud bobcat
#

bruh idk

#

shit is just hardcoded

#

theres any way to edit hardcoded items?

bitter meadow
#

you can append attribute to it

#

if you want to lower it you just use negative value

#

but it will look weird on the tooltip

#

I dont think you can do much about that

proud bobcat
#

there are any other mods that can do that?

#

its possible to edit the mod file?

bitter meadow
bitter meadow
#

definetely not legal to then use it in anything

proud bobcat
#

this one?

proud bobcat
#

just want to play with my brother

bitter meadow
#

you can also do it with kubejs but its not as elegant xd

#
let $Attributes = Java.loadClass('net.minecraft.world.entity.ai.attributes.Attributes')
let $AttributeModifier = Java.loadClass('net.minecraft.world.entity.ai.attributes.AttributeModifier')
let $ISSAttributeRegistry = Java.loadClass('io.redspace.ironsspellbooks.api.registry.AttributeRegistry')

ForgeEvents.onEvent('net.minecraftforge.event.ItemAttributeModifierEvent', event => {
if (event.itemStack.id == "minecraft:elytra" && event.slotType == 'chest') {
            
        event.addModifier("minecraft:generic.armor", new $AttributeModifier(UUID.fromString('f0c03e91-0bc7-4269-a030-7763de91441e'), 'Armor modifier', 6, 'addition'))
    };
    
})
proud bobcat
proud bobcat
bitter meadow
#

tbh I dont understand how it works thats why I prefer alembic

proud bobcat
bitter meadow
proud bobcat
#

I download alembic here, but i dont even know where I should edit

bitter meadow
#

read the wiki

#

if thats too complicated for you

#

use kubejs script

#

just change elytra to your item

proud bobcat
#

oppening the game now with the command

proud bobcat
#

idk man