#how to have multiple exceptions to `replaceInput`?

7 messages · Page 1 of 1 (latest)

hollow shore
#

i wish to replace andesite alloy in all of create's recipes that use it, except for the block, bars, funnel and tunnel. when i run either of the below code blocks in a script, however, only the tunnel recipe is left untouched, when i would've expected defining four nots to make all four of the recipes be not affected.
how would i go about defining multiple exceptions for replaceInput?

        event.replaceInput({input: "create:andesite_alloy",
        not: {id: "create:crafting/materials/andesite_alloy_block"},
        not: {id: "create:andesite_bars_from_andesite_alloy_stonecutting"},
        not: {id: "create:crafting/logistics/andesite_funnel"},
        not: {id: "create:crafting/logistics/andesite_tunnel"}
    }, "create:andesite_alloy", "architects_palette:sunmetal_brick")
        event.replaceInput({input: "create:andesite_alloy", not: {
        id: "create:crafting/materials/andesite_alloy_block",
        id: "create:andesite_bars_from_andesite_alloy_stonecutting",
        id: "create:crafting/logistics/andesite_funnel",
        id: "create:crafting/logistics/andesite_tunnel"
    }}, "create:andesite_alloy", "architects_palette:sunmetal_brick")
carmine gateBOT
#

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

willow scarab
#

put the nots in an or

versed ibexBOT
#

Recipe filters can combine other filers in different ways to enable not, and, and or logic.

  • {not: {a: b}} - not invert logic
  • {a: b, c: d} - and both must match
  • [{a: b}, {c: d}] - or either must match

Examples are:
Removes every recipe from the mod with the id mod that has an output of the item minecraft:beacon.

event.remove({mod: `mod`, output: `minecraft:beacon`})

Removes every recipe, except the ones from the mod with the id mod_id.

event.remove({not: {mod: `mod_id`}})

These logic components can also be combined.
This example removes all recipes that output modid:item_id, except one specific recipe, specified by recipe id:

event.remove({output: 'modid:item_id', not: { id: 'some:recipe_id'}})
hollow shore
#

doing this:```js
event.replaceInput({input: "create:andesite_alloy", [
{not: {id: "create:crafting/materials/andesite_alloy_block"}},
{not: {id: "create:andesite_bars_from_andesite_alloy_stonecutting"}},
{not: {id: "create:crafting/logistics/andesite_funnel"}},
{not: {id: "create:crafting/logistics/andesite_tunnel"}}
]}, "create:andesite_alloy", "architects_palette:sunmetal_brick")

`[00:02:13] [ERROR] !     event.replaceInput({input: "create:andesite_alloy", [:14: Error loading KubeJS script: server_scripts:input_replacement.js': invalid property id (server_scripts:input_replacement.js#14)`
#

okay, this works~

        event.replaceInput({input: "create:andesite_alloy", not: [
        {id: "create:crafting/materials/andesite_alloy_block"},
        {id: "create:andesite_bars_from_andesite_alloy_stonecutting"},
        {id: "create:crafting/logistics/andesite_funnel"},
        {id: "create:crafting/logistics/andesite_tunnel"}
    ]}, "create:andesite_alloy", "architects_palette:sunmetal_brick")
#

thank you!