#Correct syntax to remove/replaceInput with multiple exceptions?

5 messages · Page 1 of 1 (latest)

glad lintel
#

For example, say I want to call replaceInput({ input: 'minecraft:diamond' }, 'minecraft:diamond', 'minecraft:honeycomb') to replace all recipe uses of diamond with honeycomb.

Now, say I want to exclude a disparate set of recipes by ID, such that I can't just regex it - eg. minecraft:netherite_upgrade_smithing_template, minecraft:diamond_boots, farmersdelight:diamond_knife (these are correct recipe IDs despite looking like item IDs; I checked).

Based on what the wiki says, it seems like the correct approach would be e.replaceInput({ input: 'minecraft:diamond' , not: { id: 'minecraft:netherite_upgrade_smithing_template'}, not: { id: 'minecraft:diamond_boots'}, not: { id: 'farmersdelight:diamond_knife'} }, 'minecraft:diamond', 'minecraft:honeycomb')... but this only sort-of works. It will correctly replace all recipe inputs, though it only excludes the last of the recipes provided as nots (in this case, farmersdelight:diamond_knife), rather than all three.

lyric basinBOT
#

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

stark garden
#

would making a regex that contains all of the recipes you want gone into an array/ list, then just individually removing those before going forEach on the whole list to remove work?

stark garden
#

on second thought, making a list of all recipes would be horribly ineffective, heres what I just tested and works great for removing recipes, im sure it could be easily swapped to .replaceInput, I think looking at your code, your missing a set of [] brackets, js event.remove({ mod:'immersiveengineering', not: [ {type: 'immersiveengineering:refining'}, {type: 'immersiveengineering:fermenter'} ] })