Immersive Armors [Fabric/Forge]

Immersive Armors [Fabric/Forge]

13M Downloads

KubeJS Compability

LTCatt opened this issue ยท 0 comments

commented

I'm trying to add new attributes to armor using KubeJS. The modification code below works for both minecraft and other armor mods, only ImmersiveArmors' attributes can't be modified, neither to add nor to remove them.

Version:

Forge 1.20.1, ImmersiveArmors 1.6.1, KubeJS 2001.2.5-build.2

Reproduction:

Put the following script into kubejs/startup_scripts/armor.js, restart minecraft, and then you can notice that the attributes of the iron helmet are modified, but the bone helmet's not.

ItemEvents.modification(event => {
    let clearAttributes = item => {
        ['minecraft:generic.armor', 'minecraft:generic.armor_toughness', 'minecraft:generic.knockback_resistance', 'minecraft:generic.movement_speed'].forEach(name => {
            item.getAttributes(name).forEach(attr => { item.removeAttribute(name, attr.id) });
        });
    }
    event.modify("minecraft:iron_helmet", item => { clearAttributes(item);
        item.addAttribute("forge:entity_reach", "21673239-6017-5830-0699-800000000001", "21673239-6017-5830-0699-800000000001", 1, "ADDITION");
    });
    event.modify("immersive_armors:bone_helmet", item => { clearAttributes(item);
        item.addAttribute("forge:entity_reach", "21673239-6017-5830-0699-800000000000", "21673239-6017-5830-0699-800000000000", 1, "ADDITION");
    });
})

I understand that the mod's config allows editing of attributes, but I can't add NEW attributes to the armor. If you don't want to fix this, maybe adding a config that allows the modpack author to add new attributes to the armor would work as well :D