#Check an item for recipes?

4 messages · Page 1 of 1 (latest)

graceful pulsar
#

Trying to make a script to add items to an array for hiding/tag removal using forEachRecipe and input checks right now but it's still showing up with items that have recipes, so I am wondering if I can do this another way by checking if a specific item DOES have a recipe and query ingredients?
current code:

ServerEvents.recipes(event => {
    let finalarray = []
    event.forEachRecipe({output: /nuclear.*/}, r => {
        let ingredients = r.originalRecipeIngredients
        let output = Item.of(r.originalRecipeResult).id
        if((ingredients.length == 0) && (output != Item.of("minecraft:air", 0) && output.includes("nuclearcraft"))) {
            console.log("ingredients: " + ingredients)
            console.log("output: " + output)
            finalarray.push(output)
        }
    })
    console.log(finalarray)
})```
brave stormBOT
#

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

surreal flicker
#

I think your Problem is that you're checking weither ingredients is of length 0 an donly then running the finalarray.push code

graceful pulsar