Recipe modifier

Create a recipe modifier using KubeJS

Find all requirement types and targets that can be modified here.

//Create a modifier that add/multiply a value to any input/output requirement of the specified type.
//requirement must be specified using its id: "namespace:requirement"
//Value can be any numerical value.
//Pick one of the 6 methods below :
CMRecipeModifierBuilder.addInput(requirement, value)
CMRecipeModifierBuilder.mulInput(requirement, value)
CMRecipeModifierBuilder.expInput(requirement, value)
CMRecipeModifierBuilder.addOutput(requirement, value)
CMRecipeModifierBuilder.mulOutput(requirement, value)
CMRecipeModifierBuilder.expOutput(requirement, value)

//All methods below are optional

//Specify a target, in case the requirement have several values that can be modified.
//Only 1 target can be defined for a modifier, default is none.
.target(String target)

//Specify a chance for this modifier to be applied.
//Must be a value between 0 and 1, 0 is never applied and 1 is 100% chance to be applied.
//Default is 1.
.chance(double chance)

//Specify the maximum value that can be obtained after applying this modifier.
//It can be any numerical value.
//Default is POSITIVE_INFINITY.
.max(double max)

//Specify the minimum value that can be obtained after applying this modifier.
//It can be any numerical value.
//Default is NEGATIVE_INFINITY.
.min(double max)

//Change the tooltip displayed when holding shift while hovering the upgrade item.
//Default : a short string that describe the effect of this modifier.
.tooltip(String tooltip)
//Use Text.of("text here") for more formating options.
//See https://kubejs.com/wiki/kubejs/Text/
.tooltip(Text tooltip)

Example

A modifier that double the per-tick energy input

CMRecipeModifierBuilder.mulInput("custommachinery:energy_per_tick", 2)

A modifier that half the processing time

CMRecipeModifierBuilder.expInput("custommachinery:speed", 0.5)

Last updated