#Does `.modifyResult()` work with Smithing recipes?

12 messages · Page 1 of 1 (latest)

lapis moat
#

Can't find any exemple on how to make it work

gentle tundraBOT
#

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

pine tide
#

works with all vanilla recipes

#

it works the same way with any recipe

#

theres no difference

lapis moat
#
onEvent('recipes', event => {
    const armors = ['minecraft:leather', 'minecraft:chainmail', 'minecraft:iron', 'minecraft:diamond', 'minecraft:netherite', 'mekanismtools:refined_obsidian', 'forbidden_arcanus:draco_arcanus', 'forbidden_arcanus:tyr'];
    const material = ['minecraft:iron_ingot', 'minecraft:iron_block', 'minecraft:diamond_block', 'minecraft:netherite_ingot', 'mekanism:block_refined_obsidian', 'kubejs:draco_arcanus_plate', 'kubejs:tyr_plate']
    for (let i = 0; i < armors.length - 1; i++) {
        let currentArmor = armors[i]
        if (i == 7) return
        let nextArmor = armors[i + 1]
        addArmorUpgradeRecipe(event, currentArmor, nextArmor, material[i])
    }
})

function addArmorUpgradeRecipe(event, currentArmor, nextArmor, upgradeItem) {
    const armorTypes = ['helmet', 'chestplate', 'leggings', 'boots']
    armorTypes.forEach(armor => {
        let currentItem = `${currentArmor}_${armor}`
        let nextItem = `${nextArmor}_${armor}`

        event.smithing(nextItem, currentItem, upgradeItem)
    })
}``` That's the code I'm working with. I need to keep the input item's nbt to the result, like enchantments and durability. As the code is right now if the item has nbt, it won't work
lapis moat
#

let me see

pine tide
#

ah i dont know how to keep the nbt very_sad_kitty_lex

lapis moat
#

#1207944972565741570

#

here, I don't think it's fixed