#trying to replaceInput() but failing

1 messages · Page 1 of 1 (latest)

dapper plaza
#

Context:

  • I want to replace all iron and diamond armor inside recipes with botania and livingarmor equivalent. I thought i was being smart by making 2 arrays and do a double forEach loop, but this failed (the console.log works, but the recipes arent actually being changed)
  • using just the event.replaceInput(from, to) doesnt work either

code:

    const replaceInputArr = [
        ['minecraft:iron_helmet', 'botania:manasteel_helmet'],
        ['minecraft:iron_chestplate', 'botania:manasteel_chestplate'],
        ['minecraft:iron_leggings', 'botania:manasteel_leggings'],
        ['minecraft:iron_boots', 'botania:manasteel_boots'],
        ['minecraft:diamond_helmet', 'bloodmagic:livinghelmet'],
        ['minecraft:diamond_chestplate', 'bloodmagic:livingplate'],
        ['minecraft:diamond_leggings', 'bloodmagic:livingleggings'],
        ['minecraft:diamond_boots', 'bloodmagic:livingboots']
    ]
    const modsToChange = [
        'ars_nouveau',
        'bloodmagic',
        'rootsclassic',
        'malum'

    ]
    modsToChange.forEach(mod =>{
        replaceInputArr.forEach(recipe =>{
            let input = recipe[0]
            let output = recipe[1]
            console.log(`replacing ${input} with ${output} in mod: ${mod}`)
            event.replaceInput({mod: mod}, input, output)
        })
    })

    event.replaceInput('minecraft:iron_helmet', 'botania:manasteel_helmet')
upper meadowBOT
#

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

random cave
#

do these mods add recipes using the armor in the crafting table, cause if they use custom recipe types replaceInput won't work (only vanilla and those that have addon mods work)

#

also for the last line you would need to do event.replaceInput({}, 'minecraft:iron_helmet', 'botania:manasteel_helmet')

dapper plaza
#

need to change recipes like these:

#

guess ill have to do it the tedious way by copying over all the jsons and replace in file

random cave
#

yeah that won't work then, would need to manually overwrite or do .forEachRecipe and check if an input is that item (though this is complicated)

dapper plaza
#

meh, ill just copy over all recipes .jsons and do replace in file, and then remove all unedited files

viral sandal
#

yea and then you want to change them later and its a pain