-
Notifications
You must be signed in to change notification settings - Fork 5
KubeJS 1.18
This page shows everything you need to know about adjusting the recipes with the help of KubeJS.
Since all processing recipes have the same format, all methods can be applied to all 4 machines. They only differ in their ids which are the following:
aggregator -> Fluix Aggregator
etcher -> Circuit Etcher
grinder -> Pulse Grinder
infuser -> Matter Infuser
Each recipe consists of up to 3 input ingredients, an output stack, a processing time and an energy cost. One exception is the Grinder since it only has one input slot.
Inputs are ingredients so they support tags. They also support amounts which means a recipe with 3 stones, 2 dirt and 1 sand is completely valid.
Inputs need to be unique. A machine does not accept the same two items in different input slots. This is necessary to allow easy automation.
The recipe processing time defines the number of ticks it takes to craft the whole recipe. The energy cost defines how much energy the machine consumes for the whole recipe, not per tick.
They are optional values. If they're not defined, they will be taken from the config.
onEvent('recipes', event => {
/*
Registers a recipe for a machine with the processing time and
the energy cost from the config.
*/
event.recipes.lazierae2.machineId(ItemStackJS, IngredientJS[]);
/*
If the machine only has one input slot, the input must not be
an array!
*/
event.recipes.lazierae2.grinder(ItemStackJS, IngredientJS);
});
The machineId
has to be one of the values from the Recipe IDs section and defines the specific processing machine.
If you want to override the default processing time and/or the energy cost of a recipe, you can append the following methods to the recipe.
event.recipes.lazierae2.machineId(ItemStackJS, IngredientJS[])
.processingTime(50) // 50 ticks for the whole recipe
.energyCost(500); // 500 FE for the whole recipe
You can also register new recipes by using event.custom()
if you pass the whole recipe object.
Adding a triple input (3x stone, apple, 5x potato) recipe to the Fluix Aggregator with 3x dirt being the result. It has a processing time of 200 ticks (10 seconds) and an energy cost of 300 FE.
onEvent('recipes', event => {
event.recipes.lazierae2.aggregator('3x dirt', ['3x stone', 'apple', '5x potato'])
.processingTime(200)
.energyCost(300);
// other valid syntaxes for ingredients and stacks are also supported
event.recipes.lazierae2.aggregator(Item.of('minecraft:dirt', 3), [
'3x stone', 'apple', Ingredient.of('potato', 5)
])
.processingTime(200)
.energyCost(300)
.id('mymodpack:aggregator/my_recipe'); // you can also append a custom recipe id
});
Adding a double input (2x apple, 3x dirt) recipe to the Circuit Etcher with 2x stone being the result. The processing time and energy cost are omitted and are taken from the config.
onEvent('recipes', event => {
event.recipes.lazierae2.etcher('3x stone', ['2x apple', '3x dirt']);
});
Adding a single input (3x dirt) recipe to the Pulse Grinder with 2x stone being the result. The processing time and energy cost are omitted and are taken from the config.
onEvent('recipes', event => {
event.recipes.lazierae2.grinder('2x stone', Ingredient.of('dirt', 3));
});