#Replace ingredient excluding certain recipes.

5 messages · Page 1 of 1 (latest)

eternal lintel
#

So I have the following code to replace limes in recipes with a tag:

    // limes 
    event.replaceInput(
        { input: 'collectorsreap:lime' }, // Arg 1: the filter
        'collectorsreap:lime',            // Arg 2: the item to replace
        '#collectorsreap:lime_or_slice'         // Arg 3: the item to replace it with
    )

But I would like to exclude certain recipes, such as collectorsreap:lime_crate and collectorsreap:lime_slice. How can I exclude them from the above code?

silver oracleBOT
#

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

eternal lintel
#

I tried this,but it didn't work:

event.replaceInput(
        {not: {output: 'collectorsreap:lime_crate'}},
        { input: 'collectorsreap:lime' }, // Arg 1: the filter
        'collectorsreap:lime',            // Arg 2: the item to replace
        '#collectorsreap:lime_or_slice'         // Arg 3: the item to replace it with
    )
#

Okay I got the syntax wrong, the "not" needs to go inside the "input" clause

#

However, I'm having trouble figuring out how to select multiple recipes for the "not"

Scratch that, I figured it out. Final code:

    // limes 
    event.replaceInput(
        {not: 
        [{output: 'collectorsreap:lime_crate'}, 
        {output: 'collectorsreap:lime_seeds'}, 
        {output: 'collectorsreap:lime_slice'},],
        input: 'collectorsreap:lime' }, // Arg 1: the filter
        'collectorsreap:lime',            // Arg 2: the item to replace
        '#collectorsreap:lime_or_slice'         // Arg 3: the item to replace it with
    )