#Extended Crafting Recipe Creation

83 messages · Page 1 of 1 (latest)

steady minnow
#

So Im creating my very own modpack and honestly Im trying to figure out how to add custom recipe with the Extended Crafting mod but cant for the life of me figure it out :/
I know you use e.custom but how?

fair trellisBOT
#

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

oblique geyser
#

you sohuldn't need to use e.custom in this case

#

you can use event.recipes.extendedcrafting.shaped_table and event.recipes.extendedcrafting.shapeless_table

steady minnow
#

oh? then what would I do because im still learning :3

oblique geyser
#

which have the same syntax as e.shaped and e.shapeless

oblique geyser
steady minnow
#

ohhh! okay :3

#

can i leave this open for a little bit :3

oblique geyser
#

ofc heh

frozen dust
#

event.custom works for every type of recipe since it turns directly into the datapack json, but certain mods + vanilla define their own recipe functions that make it way easier

steady minnow
#

Oh okay see the more i know the better because i also have to make custom powah recipes and such.

frozen dust
#

luckily powah is one of the mods that has an addon that adds support

#

fuck how do markdown links work

oblique geyser
oblique geyser
hard pilot
oblique geyser
#

oh yea

#

but you can always make a custom function for it heh

hard pilot
#

yep

oblique geyser
#

I actually have one from one of my unfinished modpacks (hoh)

#

let me grab it

#

one sec

#
let energizing = (result, ingredients, power, id) => {
    e.custom({
        type: 'powah:energizing'
        ingredients: ingredients.map(i => Ingredient.of(i).toJson()),
        energy: power,
        result: Item.of(result).toJson()
    }).id(id)
}
//example usage:
energizing('diamond', ['dirt', 'dirt', 'stick', 'coal'], 100000, 'modpack_name:my_cool_energizing_recipe')
hard pilot
#

this should break If id is not defined, make a check thet makes sure id is defined If you want to use this (or remove the id overwrite entirely)

steady minnow
hard pilot
#
function applyID(event, id, recipe) { 
         typeof id == "string" ? event.custom(recipe).id(id) : event.custom(recipe) 
 }

And Pass in the params

#

define this outside of the recipes Event

#

Or inside, then you can remove the Event param

modest condor
steady minnow
modest condor
#

Tried it myself, it's integration just seems incomplete

oblique geyser
#

so if you want to use a specific tier, than use e.custom

frozen dust
#

actually, based on the example recipes they have on github, the tier is only based on the size of the shaped recipe

#

or a tier argument on shapeless ones sometimes

#

the kjs methods should work correctly because of that

steady minnow
#

oh im dumb

#

wait no im not x3

#

what exactly is that part for x3

steady minnow
#

i know im doing something wrong x3

sick pulsarBOT
#

Paste version of CustomPowahRecipes.js from @steady minnow

steady minnow
#

how do i define a function lmao

frozen dust
#

just do energizing

#

not e.energizing

#

e.blah means it's a part of the event

#

but just doing blah() means it's just a function on its own

steady minnow
#

so i dont need the onevent?

frozen dust
#

well it still needs the event to call e.custom

steady minnow
#

just no e.?

frozen dust
#

mhm

#

see if you can find a way to pass e into the function so that it knows about it and can call e.custom from the function

steady minnow
#

its still erroring

frozen dust
#

is it because e is not defined?

steady minnow
#

even errors without onEvent being called

#

so am I doing something wrong or?

frozen dust
#

wait actually try moving the function into the onEvent block

steady minnow
#

okay one sec

frozen dust
#

like this

onEvent('recipes', e => {
  function energizing(result, ingredients, power, id) {
    e.custom({
        type: 'powah:energizing',
        ingredients: ingredients.map(i => Ingredient.of(i).toJson()),
        energy: power,
        result: Item.of(result).toJson()
    }).id(id)
  }

  energizing('diamond', ['dirt', 'dirt', 'stick', 'coal'], 100000, 'modpack_name:my_cool_energizing_recipe')
  energizing('diamond', ['powah:crystal_nitro'], 15000, 'Astros:Chickens')
})
steady minnow
#

what about the other function?

#

there is 2

frozen dust
#

hold on one sec

steady minnow
#

actually i think i found a way :3

#

wait nvm thats only for a single item

steady minnow
#

will this work?

#

this is just a test one

sick pulsarBOT
#

Paste version of CustomPowahRecipes.js from @steady minnow

steady minnow
#

OMG I DID IT!

#

ignore the untexture item, Its a custom item that needs texture made

modest condor
frozen dust
#

well wouldn't all of the applicable tables would have to be smaller?

#

why would you want something to be done on a 3x3 but not a 5x5

modest condor
#

Because it’s ugly and obnoxious ahujel

frozen dust
#

well if kubejs methods are ugly and obnoxious then just use datapacks directly ???

modest condor
#

When did I say Kube was ugly?

frozen dust
#

wait what were you calling ugly then?

modest condor
#

Multiple recipes duplicated to all the tables