#How do you make a Rolling recipe from Create Crafts and Additions?

17 messages · Page 1 of 1 (latest)

lone dagger
#

Lets say as a test, i want to turn iron plates into dirt. What would code for that look like? I'm not getting an error message, but the recipe is not in JEI nor does it work in testing. My current code is:

ServerEvents.recipes(event => {

  event.custom({
    "type":"createaddition:rolling",
    "input": {
          "tag": "forge:plates/iron"
    },
    "result": {
        "item": "minecraft:dirt",
        "count": 2
    }
})

}) //END
vernal gardenBOT
#

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

loud dirge
#

why did you make another ticket?

lone dagger
#

the others were behaving strangely

#

it was taking like 30 clicks for me to open them

fossil monolithBOT
#

You can find your KubeJS server log in /minecraft/logs/kubejs/server.log.
If you are on 1.18 or below it will be called server.txt.
Please send it if asked, as it contains helpful information.

nimble mesa
#
function rolling (output, input, count) {
        event.custom({
            "type":"createaddition:rolling",
            "input": Ingredient.of(input).toJson(),
            "result": Item.of(count+'x '+output).toResultJson()
        }).id(CA+':rolling/'+output.replace(":","/"))
    }

my function is this and it is working fine (i am on 1.18.2 but shouldn't matter)

loud dirge
#

oh god no

nimble mesa
loud dirge
#

it's just... your code can be way better

nimble mesa
#

Yes i know. My older scrips are kinda weird.

#

I need to redo all of my scripts one day but meh.

loud dirge
#

my old scripts are... worse then bad

#
let rolling = (e, output, input, id) => {
    e.custom({
        type: 'createaddition:rolling',
        input: Ingredient.of(input).toJson(),
        result: (typeof output == 'object' ? output : Ingredient.of(output)).toJson()
    }).id(id ?? `createaddition:rolling/${output.replace(':', '/')}`)
}

// example usage:
ServerEvents.recipes(e => {
    rolling(e, 'emerald', 'diamond')
    rolling(e, Item.of('stick', 16), 'dirt', 'modpack:dirt_to_sticks') // the 4th param is the recipe id
})
lone dagger