KubeJS Create


Download: CurseForge, Modrinth

The example scripts are only here to demonstrate the recipes. They are not meant to be used with the items shown.

#Compacting

Syntax: compacting(output[], input[])
Compacting uses the Mechanical Press, Basin and optionally a Blaze Burner.
Features:
  • supports multiple inputs and outputs
  • supports .heated() and .superheated()
  • can have a fluid output as long as it has another item output
  • supports chance-based output
ServerEvents.recipes(event => {
  event.recipes.create.compacting('minecraft:diamond', 'minecraft:coal_block')
  event.recipes.create.compacting('minecraft:diamond', 'minecraft:coal_block').heated()
  event.recipes.create.compacting('minecraft:diamond', 'minecraft:coal_block').superheated()
  event.recipes.create.compacting([Fluid.water(10), 'minecraft:dead_bush'], ['#minecraft:saplings', '#minecraft:saplings'])
  event.recipes.create.compacting(['minecraft:diamond', Item.of('minecraft:diamond').withChance(0.3)], 'minecraft:coal_block')
})

#Crushing

Syntax: crushing(output[], input)
Crushing uses the Crushing Wheels
Features:
  • supports multiple chance-based outputs
  • supports .processingTime()
ServerEvents.recipes(event => {
  event.recipes.create.crushing('minecraft:diamond', 'minecraft:coal_block')
  event.recipes.create.crushing('minecraft:diamond', 'minecraft:coal_block').processingTime(500)
  event.recipes.create.crushing(['minecraft:diamond', Item.of('minecraft:diamond').withChance(0.5)], 'minecraft:coal_block')
})

#Cutting

Syntax: cutting(output[], input)
Cutting uses the Mechanical Saw
Features:
  • supports multiple chance-based outputs
  • supports .processingTime()
ServerEvents.recipes(event => {
  event.recipes.create.cutting('minecraft:diamond', 'minecraft:coal_block')
  event.recipes.create.cutting('minecraft:diamond', 'minecraft:coal_block').processingTime(500)
  event.recipes.create.cutting(['minecraft:diamond', Item.of('minecraft:diamond').withChance(0.5)], 'minecraft:coal_block')
})

#Deploying

Syntax: deploying(output[], input[])
Deploying uses the Deployer
Features:
  • supports multiple chance-based outputs
  • requires exactly two inputs, the second input is what the Deployer is holding
  • supports .keepHeldItem()
ServerEvents.recipes(event => {
  event.recipes.create.deploying('minecraft:diamond', ['minecraft:coal_block', 'minecraft:sand'])
  event.recipes.create.deploying(['minecraft:diamond', 'minecraft:emerald'], ['minecraft:coal_block', 'minecraft:sand']).keepHeldItem()
  event.recipes.create.deploying(['minecraft:diamond', Item.of('minecraft:diamond').withChance(0.5)], ['minecraft:coal_block', 'minecraft:sand'])
})

#Emptying

Syntax: emptying(output[], input)
Emptying uses the Item Drain
Features:
  • requires one input and two outputs, the outputs must be an item and a fluid
ServerEvents.recipes(event => {
  event.recipes.create.emptying([Fluid.water(), 'minecraft:bucket'], 'minecraft:water_bucket')
})

#Filling

Syntax: filling(output, input[])
Filling uses the Spout
Features:
  • requires two inputs and one output, the inputs must be an item and a fluid
ServerEvents.recipes(event => {
  event.recipes.create.filling('minecraft:water_bucket', [Fluid.water(), 'minecraft:bucket'])
})

#Haunting

Syntax: haunting(output[], input)
Haunting uses the Encased Fan and Soul Fire
Features:
  • supports multiple chance-based outputs
ServerEvents.recipes(event => {
  event.recipes.create.haunting('minecraft:soul_campfire', 'minecraft:campfire')
  event.recipes.create.haunting(['minecraft:wheat', 'minecraft:oak_sapling'], 'minecraft:potato')
  event.recipes.create.haunting(['minecraft:wheat', Item.of('minecraft:oak_sapling').withChance(0.2)], 'minecraft:potato')
})

#Mechanical Crafting

Syntax: mechanical_crafting(output, pattern[], key{})
Mechanical Crafting uses Mechanical Crafters
Features:
  • mostly identical to the default Shaped Crafting
  • supports up to 9x9 grid size
ServerEvents.recipes(event => {
  event.recipes.create.mechanical_crafting('minecraft:emerald', [
    ' DDD ',
    'D   D',
    'D   D',
    'D   D',
    ' DDD '
  ], {
    D: 'minecraft:dirt'
  })
})

#Milling

Syntax: milling(output[], input)
Milling uses the Millstone
Features:
  • supports multiple chance-based outputs
ServerEvents.recipes(event => {
  event.recipes.create.milling('minecraft:diamond', 'minecraft:coal_block')
  event.recipes.create.milling(['minecraft:diamond', 'minecraft:emerald'], 'minecraft:coal_block')
  event.recipes.create.milling(['minecraft:diamond', Item.of('minecraft:diamond').withChance(0.5)], 'minecraft:coal_block')
})

#Mixing

Syntax: mixing(output[], input[])
Mixing uses the Mechanical Mixer, Basin, and optionally a Blaze Burner
Features:
  • supports multiple chance-based outputs
  • supports fluid inputs and outputs
  • supports .heated() and .superheated()
ServerEvents.recipes(event => {
  event.recipes.create.mixing('minecraft:diamond', 'minecraft:coal_block')
  event.recipes.create.mixing('minecraft:diamond', 'minecraft:coal_block').heated()
  event.recipes.create.mixing('minecraft:diamond', 'minecraft:coal_block').superheated()
  event.recipes.create.mixing([Fluid.water(10), 'minecraft:dead_bush'], ['#minecraft:saplings', '#minecraft:saplings'])
  event.recipes.create.mixing(['minecraft:diamond', Item.of('minecraft:diamond').withChance(0.3)], 'minecraft:coal_block')
})

#Pressing

Syntax: pressing(output[], input)
Pressing uses the Mechanical Press
Features:
  • supports multiple chance-based outputs
ServerEvents.recipes(event => {
  event.recipes.create.pressing('minecraft:diamond', 'minecraft:coal_block')
  event.recipes.create.pressing(['minecraft:diamond', 'minecraft:emerald'], 'minecraft:coal_block')
  event.recipes.create.pressing(['minecraft:diamond', Item.of('minecraft:diamond').withChance(0.5)], 'minecraft:coal_block')
})

#Sandpaper Polishing

Syntax: sandpaper_polishing(output, input)
Sandpaper Polishing uses any item tagged with create:sandpaper
Features:
  • supports chance-based output
ServerEvents.recipes(event => {
  event.recipes.create.sandpaper_polishing('minecraft:diamond', 'minecraft:coal_block')
  event.recipes.create.sandpaper_polishing(Item.of('minecraft:diamond').withChance(0.5), 'minecraft:coal_block')
})

#Sequenced Assembly

Syntax: sequenced_assembly(output[], input, sequence[]).transitionalItem(item).loops(int)
Output is an item or an array of items. If it is an array:
  • The first item is the real output, the remainder is scrap.
  • Only one item is chosen, with an equal chance of each.
  • You can use Item.of('create:shaft').withChance(2) to double the chance of that item being chosen.
Transitional Item is any item used during the intermediate stages of the assembly.
Sequence is an array of recipes of the following types:
  • create:cutting
  • create:pressing
  • create:deploying
  • create:filling
The transitional item needs to be the input and output of each of these recipes.
Loops is the number of times that the recipe repeats. Calling .loops() is optional and defaults to 4.
ServerEvents.recipes(event => {
	event.recipes.create.sequenced_assembly([
		Item.of('create:precision_mechanism').withChance(130.0), // this is the item that will appear in JEI as the result
		Item.of('create:golden_sheet').withChance(8.0), // the rest of these items will be part of the scrap
		Item.of('create:andesite_alloy').withChance(8.0),
		Item.of('create:cogwheel').withChance(5.0),
		Item.of('create:shaft').withChance(2.0),
		Item.of('create:crushed_gold_ore').withChance(2.0),
		Item.of('2x minecraft:gold_nugget').withChance(2.0),
		'minecraft:iron_ingot',
		'minecraft:clock'
	], 'create:golden_sheet', [ // 'create:golden_sheet' is the input
		// the transitional item set by `transitionalItem('create:incomplete_large_cogwheel')` is the item used during the intermediate stages of the assembly
		event.recipes.createDeploying('create:incomplete_precision_mechanism', ['create:incomplete_precision_mechanism', 'create:cogwheel']),
		// like a normal recipe function, is used as a sequence step in this array. Input and output have the transitional item
		event.recipes.createDeploying('create:incomplete_precision_mechanism', ['create:incomplete_precision_mechanism', 'create:large_cogwheel']),
		event.recipes.createDeploying('create:incomplete_precision_mechanism', ['create:incomplete_precision_mechanism', 'minecraft:iron_nugget'])
	]).transitionalItem('create:incomplete_precision_mechanism').loops(5) // set the transitional item and the number of loops

	// for this code to work, kubejs:incomplete_spore_blossom needs to be added to the game
	let inter = 'kubejs:incomplete_spore_blossom' // making a variable to store the transitional item makes the code more readable
	event.recipes.create.sequenced_assembly([
		Item.of('minecraft:spore_blossom').withChance(16.0), // this is the item that will appear in JEI as the result
		Item.of('minecraft:flowering_azalea_leaves').withChance(16.0), // the rest of these items will be part of the scrap
		Item.of('minecraft:azalea_leaves').withChance(2.0),
		'minecraft:oak_leaves',
		'minecraft:spruce_leaves',
		'minecraft:birch_leaves',
		'minecraft:jungle_leaves',
		'minecraft:acacia_leaves',
		'minecraft:dark_oak_leaves'
	], 'minecraft:flowering_azalea_leaves', [ // 'minecraft:flowering_azalea_leaves' is the input
		// the transitional item is a variable, that is 'kubejs:incomplete_spore_blossom' and is used during the intermediate stages of the assembly
		event.recipes.createPressing(inter, inter),
		// like a normal recipe function, is used as a sequence step in this array. Input and output have the transitional item
		event.recipes.createDeploying(inter, [inter, 'minecraft:hanging_roots']),
		event.recipes.createFilling(inter, [inter, Fluid.water(420)]),
		event.recipes.createDeploying(inter, [inter, 'minecraft:moss_carpet']),
		event.recipes.createCutting(inter, inter)
	]).transitionalItem(inter).loops(2) // set the transitional item and the number of loops
})

#Transitional Items

As mentioned earlier, any item can be a transition item. However, this is not completely recommended.
If you wish to make your own transitional item, it's best if you make the type create:sequenced_assembly.
StartupEvents.registry('item', event => {
	event.create('incomplete_spore_blossom', 'create:sequenced_assembly')
})

#Splashing/Washing

Syntax: splashing(output[], input)
Splashing/Washing uses the Encased Fan and Water
Features:
  • supports multiple chance-based outputs
  • uses the
ServerEvents.recipes(event => {
  event.recipes.create.splashing('minecraft:soul_campfire', 'minecraft:campfire')
  event.recipes.create.splashing(['minecraft:wheat', 'minecraft:oak_sapling'], 'minecraft:potato')
  event.recipes.create.splashing(['minecraft:wheat', Item.of('minecraft:oak_sapling').withChance(0.2)], 'minecraft:potato')
})

#Mysterious Conversion

Mysterious Conversion recipes go in client_scripts/, outside of any event listeners. Currently the only way to add them is through reflection.
let $MysteriousItemConversionCategory = Java.loadClass('com.simibubi.create.compat.jei.category.MysteriousItemConversionCategory')
let $ConversionRecipe = Java.loadClass('com.simibubi.create.compat.jei.ConversionRecipe')

$MysteriousItemConversionCategory.RECIPES.add($ConversionRecipe.create('minecraft:apple', 'minecraft:carrot'))
$MysteriousItemConversionCategory.RECIPES.add($ConversionRecipe.create('minecraft:golden_apple', 'minecraft:golden_carrot'))

#Preventing Recipe Auto-Generation

If you don't want smelting, blasting, smoking, crafting, or stonecutting to get an auto-generated counterpart, then include manual_only at the end of the recipe id:
ServerEvents.recipes(event => {
	event.shapeless('minecraft:wet_sponge', ['minecraft:water_bucket', 'minecraft:sponge']).id('kubejs:moisting_the_sponge_manual_only')
})
Other types of prevention can be done in the create config. If it's not in the config, than you can't change it.