#Recipe questions

14 messages · Page 1 of 1 (latest)

red spade
#

I'm trying to remove a decent amount of essence using recipes from mystical agriculture.
To then add custom ones.

My question is do I have to remove them all by recipe ID.
Or can I just remove say by input to then make custom recipes say probably in a data pack or something.
Maybe through Kube but I haven't decided how I am wanting to add in the custom recipes with how complex this mod pack is going to be.

TLDR:
If I remove recipes by input and add in custom recipes using those same items will it break?
If it doesn't break will it break if I use data pack instead of Kube or do I have to use Kube?

weary lightBOT
#

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

plucky solar
#

If I'm understanding your question right, you can remove recipes then add them even if they use the same items. But you have to do it in that order. Remove existing, add new

#

The order is determined by top down

#

Personally, I just split it into functions and have the events like this
Remove(event)
Modify(event)
Add(event)

red spade
#

Would I be able to do it in two separate files? I prefer to have a removal file and an add file.

plucky solar
#

Oh, or you can use abstraction. My main.js host all my listeners, but I have all the actual functions used somewhere else. What I do is I pass the event into the function name
You can do the same here but for your recipes. Have somewhere where you just simply obtain the recipe event and pass it to all other functions that use that event

#

For example (will be typed horrible and probably won't work as I'm on my phone)
(Main)

SeverEvents.recipies(event => { remove_recipies(event);
add_recipies(event);
}

(removed_recipeis.js)

function remove_recipies(event) {
...
}
red spade
#

If you could. When you get the chance could you send the files because I've never used functions never have had a use for them or understood what use they actually provide.

I do copy paste and add a separate event thing for every recipe or whatever even if it's repetitive I don't have to type the repetitive part with copy paste.

plucky solar
#

Well that's one of the things functions are great for. They reduce repetition by abstraction.
An example, let's say you need to add two numbers, x and t, together and multiply them by a scaler, z. Instead of writing let num = (1 + 2) * 6 ... num = (3 + 4) * 7 ...
You can instead write a function like this JavaSctipt function do_thing (x, y, z) { return ((x + y) * z) } ... let num = do_thing(1,2,3) .. num = do_thing(3,4,7)

#

But yea id def recommend looking into functions as a general coding idea. They are quite useful.
Functional programming (a type of programming) uses nearly exclusively functions just because they are that useful

#

Can look at classes too, but even a class can be written in a function format so its not to big of a concern (plus classes don't work in kubejs)

#

I'll post my files when I'm home but it will be several hours