#forEachRecipe doesn't seem to work in KJS 6.1

45 messages · Page 1 of 1 (latest)

spice tapir
#

It worked fine on version 6.0 and stopped working on 6.1
I think it doesn't generate something in logs

ServerEvents.recipes(e => {
    e.forEachRecipe({ type: 'minecraft:crafting_shaped', output: '#minecraft:slabs' }, r => {
        let ingredients = r.originalRecipeIngredients
        let output = r.originalRecipeResult
        e.shapeless(Item.of(output.id, 2), [ingredients[0], `#${ct}saws`]).damageIngredient(`#${ct}saws`).id(r.getOrCreateId())
    })
})
rain mossBOT
#

Paste version of server.log from @spice tapir

viral hemlockBOT
#

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

slim summit
#

does it work without a tag in the filter?

spice tapir
#

no

#

it's also weird cause other forEachRecipe works fine

#

and they have almost no different

slim summit
#

what is the other one

spice tapir
#
e.forEachRecipe({ type: 'minecraft:crafting_shapeless', output: '#minecraft:planks', input: '#minecraft:logs' }, r => {
        let ingredients = r.originalRecipeIngredients
        let output = r.originalRecipeResult
        e.shapeless(Item.of(output.id, 4), [ingredients[0], `#${ct}saws`]).damageIngredient(`#${ct}saws`)
    })
slim summit
#

huh

spice tapir
#

any ideas?

#

😔

slim summit
#

it could be a mod doing weird runtime tag modification on some tags but not others

spice tapir
#

I don't think so, because this one doesn't work too:

e.forEachRecipe({output: /modern_industrialization:\w*rod/, type: `${mi}cutting_machine`, not: {input: /modern_industrialization:\w+double_ingot/}}, r => {
        e.recipes.modern_industrialization.lathe(8, 200)
        .itemIn(r.originalRecipeIngredients[0])
        .itemOut(Item.of(r.originalRecipeResult, 1))
        .id(r.getOrCreateId())
    })

#

it worked on 6.0 version

spice tapir
#

yea those scripts are loading, so I don't know what is the problem

spice tapir
#

I want a solution to this problemsad

spice tapir
#

@smoky beacon

smoky beacon
#

oh snap chatgtp?

spice tapir
#

you mean i should ask a chatgpt?

wild swan
smoky beacon
#

no i was asking if thats what you used for this

wild swan
#

??ai

rain mossBOT
# wild swan ??ai

NEVER use any AI to generate KubeJS code. They currently know very little about it, and what they do know is often outdated or false. You can instead look at the KubeJS wiki or ask for help in #1047320998199955458.

smoky beacon
#

^

#

just looks like something cgtp would cough up

spice tapir
smoky beacon
#

ah ok

#

hmm seems like theres just a lot of dupe recipes

#

so its using the last one encountered, have you specifically removed each of these recipes in another script?

#

ideally by recipe id

#

try removing some of the recipes by recipe id with this script and see if it fixes it

rain mossBOT
#

Paste version of removerecipe.js from @smoky beacon

smoky beacon
#

so its forced to use your custom recipes

spice tapir
#

so I need to remove all slabs recipes?🫠

smoky beacon
#

i would just test it out on one recipe first to see if it fixes it first of all

spice tapir
#

but removing recipes by id is a pain

smoky beacon
#

lmao gl with it my man

#

if it makes you feel any better theres over 100 lines of script ive got to write manually today so i feel ya sad

wild swan
#

if the ids are in a specific format

spice tapir
#

yea i did it for rods

#

but i don't know how i will do it with slabs