Adding and Removing Recipes
Removing Recipes
Removing GTCEu Modern recipes with KubeJS works the same as any other recipe, meaning they can be removed by: ID, Mod, Input, Output, Type or a Mixture.
gtceu_removal.js
ServerEvents.recipes(event => {
event.remove({ id: 'gtceu:smelting/sticky_resin_from_slime' }) // (1)
event.remove({ mod: 'gtceu' }) // (2)
event.remove({ type: 'gtceu:arc_furnace' }) // (3)
event.remove({ input: '#forge:ingots/iron' }) // (4)
event.remove({ output: 'minecraft:cobblestone' }) // (5)
event.remove({ type: 'gtceu:assembler', input: '#forge:plates/steel' }) // (6)
})
- Targets the slime to sticky resin furnace recipe only for removal.
- Targets all recipes under the gtceu mod id for removal.
- Targets all recipes in the arc furnace for removal.
- Targets all recipes that have an input of
#forge:ingots/iron
for removal. - Targets all recipes that have an output of
minecraft:cobblestone
for removal. - Targets all recipes in the gtceu assembler that have an input of
#forge:plates/steel
for removal.
Modifiying Recipes
With KubeJS it is possible to modfiy the Inputs or Outputs of existing GTCEu Modern recipes, which uses the same method of targeting the recipes.
gtceu_modify.js
ServerEvents.recipes(event => {
event.replaceInput({ mod: 'gtceu' }, 'minecraft:sand', '#forge:sand') // (1)
event.replaceOutput({ type: 'gtceu:arc_furnace' }, 'gtceu:wrought_iron_ingot', 'minecraft:dirt') // (2)
})
- Targets all gtceu recipes that have and input of
minecraft:sand
and replaces it with#forge:sand
. - Targets all gtceu arc furnace recipes that have and output of
gtceu:wrought_iron_ingot
and replaces it withminecraft:dirt
.
Adding Recipes
Syntax: event.recipes.gtceu.RECIPE_TYPE(string: recipe id)
gtceu_add.js
ServerEvents.recipes(event => {
event.recipes.gtceu.assembler('test')
.itemInputs(
'64x minecraft:dirt',
'32x minecraft:diamond'
)
.inputFluids(
Fluid.of('minecraft:lava', 1500)
)
.itemOutputs(
'minecraft:stick'
)
.duration(100)
.EUt(30)
})
Event Addons
- Inputs:
- Items:
.itemInput()
.itemInputs()
.chancedInput()
.notConsumable()
- Fluids:
.inputFluids()
.chancedFluidInput()
- Misc:
.circuit()
- Items:
- Outputs:
- Items:
.itemOutput()
.itemOutputs()
.chancedOutput()
- Fluids:
.outputFluids
.chancedFluidOutput()
- Items:
- Energy:
Research
In GTCEu there exists the Research System
which allows for adding extra requirements to recipes such as: Scanner Research, Station Research and Computation.
scanner_research.js
ServerEvents.recipes(event => {
event.recipes.gtceu.assembly_line('scanner_test')
.itemInputs('64x minecraft:coal')
.itemOutputs('minecraft:diamond')
.duration(10000)
.EUt(GTValues.VA[GTValues.IV])
["scannerResearch(java.util.function.UnaryOperator)"](b => b.researchStack(Item.of('minecraft:coal_block')).EUt(GTValues.VA[GTValues.IV]).duration(420)) // (1)
})
- Note due to a
JS Moment
you have to forcescannerResearch
to be interpreted by Rhino in a specific way. Scanner Research accepts anItemStack
input in the.researchStack()
object, and you can also define theEUt
andDuration
outside of the.researchStack()
object.
station_research
ServerEvents.recipes(event => {
event.recipes.gtceu.assembly_line('station_test')
.itemInputs('64x minecraft:coal')
.itemOutputs('minecraft:diamond')
.duration(10000)
.EUt(GTValues.VA[GTValues.IV])
.stationResearch(b => b.researchStack(Item.of('minecraft:coal_block')).EUt(GTValues.VA[GTValues.IV]).CWUt(10)) // (1)
})
- Just like
Scanner Research
Station Research
accepts anItemStack
input in the.researchStack()
object, however you can only defineEUt
andCWUt
outside of the.researchStack()
object.CWUt
is used to define the duration of theStation Research
recipe.
Rhino Jank
Warning
Due to some Rhino Jank, when adding rock breaker recipes you will need to manually tell Rhino how to interpret .addData()
.
rhino_jank_rock_breaker.js
ServerEvents.recipes(event => {
const RockBreakerCondition = Java.loadClass("com.gregtechceu.gtceu.common.recipe.RockBreakerCondition")
event.recipes.gtceu.rock_breaker('rhino_jank')
.notConsumable('minecraft:dirt')
.itemOutputs('minecraft:dirt')
["addData(java.lang.String,java.lang.String)"]("fluidA", "minecraft:lava")
["addData(java.lang.String,java.lang.String)"]("fluidB", "minecraft:water")
.duration(16)
.EUt(30)
.addCondition(RockBreakerCondition.INSTANCE)
})