your current location:首页 > news>Kubejs6 Formula Magic Reform Tutorial for Novice [KJS] Kubejs Minecraft Game

Kubejs6 Formula Magic Reform Tutorial for Novice [KJS] Kubejs Minecraft Game

2024-12-05 23:05:55|Myriagame |source:minecraft skins

Written at the forefront: This tutorial facing the goal is a pure newbie who is the first contact with the magic reform module. It mainly tells the method and instance of the formula modification, which will not involve deep content.question.

Kubejs 6 applicable version is 1.19.2-1.21.1

The tutorial refers to the official Kubejs Wiki, and refers to some code of the integrated package E6E, as well as other series of personal tutorials.

What is a magic reform

1. About Kubejs

Kubejs is a magic reform module suitable for higher versions of the collocation package. Through it, it can change/add/delete a series of synthetic tables, items, fluids, events, etc., so as to contact each module of the integrated package you made to achieve you to achieve youExpected effect.

*For example: you can make an arbitrarily decompose to two wooden boards, not the original 4.

2. Select Kubejs's Affiliated Module

Kubejs module body (must choose)

PROBEJS auxiliary writing magic reform content provides VSCODE support (must be selected)

Kubejs Create/Kubejs Thermal/Kubejs Botania/Kubejs Mekanism/Kubejs Art Nouveau/... When you have these modules in your integration package, it provides a simpler way of writing.

Start your first magic reform

How to start

First, open your Minecraft game (make sure the corresponding module is installed).

Enter instructions/Probejs Dump and wait for a period of time // You need to install the Probejs module.

Right -click your .minecraft folder and select "Open in vSCode" // Do not turn off the game!

Create a new file below the .minecraft/kubejs/server_scripts, named xxx.js (you can also create a new folder below, create a file in the folder)

(Picture shows an example)

Figure showing examples

Step first modification

Enter the following in the file you created:

<<<<<<] = "assh: none;">> serverersion

})

This is the most basic part, and the next formula will be carried out in this bracket.

Remove a formula

Example: In the case of adding the twilight forest module, do you think that the disassembly station has destroyed the balance?Below is an example of removing the dismantling formula

<<<<<<] = "assh: none;">> serverersion

Event.remove ({Output: 'TwilightForest: Uncrfting_table'}) // Remove the disassembly platform

})

Use the/RELOAD instruction to re -load the modification. Now you can determine whether the formula is successfully added in the game.

Obviously, in most cases, the modification of a single formula is too inefficient. How can we delete the formula of a type of formula?

Quote from Kubejs official Wiki and translate and partial explanation.

 // Translation will be translated in the code format

// Remove all formulas that meet the conditions (conditions: output stone draft)

event.remove ({output: 'mincrft: stone_pickaxe'})

// Remove all recipes that meet the conditions (Conditions: Outputs with labels '#Minecraft: Wool', that is, all wool items)

Event.remove ({Output: '#Minecraft: Wool'})

// Supplement: We use tags to refer to one type of items. Similarly, the label can also be obtained through command/kubejs hand

// Remove all formulas that meet the conditions (Conditions: Enter the item with a label '#Forge: dusts/redstone' that is red stone powder)

event.remove ({input: '#Forge: dusts/redstone'})

// Remove all recipes that meet the conditions (Conditions: Add by module farmers and music affairs)

Event.remove ({MOD: 'Farmersdelight'}) // Supplement: Similar to items ID, modid is 'Farmersdelight' can refer to a mod, which can also be obtained by command/kubejs hand

// Remove all formulas that meet the conditions (Conditions: Formula type is firing of camp fire)

Event.remove ({Type: 'Minecraft: Campfire_Cooking'})

// Type refers to the synthesis method, such as 'mincrft: crafting_shaped' refers to all formal synthetic formulas

// Remove all formulas that meet the conditions (Condition 1: Formula type*not*for blast furnace furnace furnace, condition 2: output items are stone) Conditions 1, 2 need to be available at the same time*Similarly to remove it before it will be removed to be removed before it will be removed to be removed before it will be removed to be removed before it will be removed to be removed before it will be removed to be removed before it will be removed to be removed before it will be removed to be removed before it will be removed to be removed to be removed.

event.remove ({not: {type: 'minecraft: delting'}, output: 'stone'})

// Remove all formulas that meet the conditions (Condition 1: Output items are cooked chicken, condition 2: formula type is camp fire burning) Condition 1, 2 needs*at the same time*Similarly to remove it before it will be removed to be removed before it will be removed.

Event.remove ({Output: 'Minecraft: Cooked_chicken', Type: 'Minecraft: Campfire_Cooking'})

// Remove all formulas that meet the conditions (Condition 1: The formula type is blast furnace furnace furnace, condition 2: output items are iron ingots, conditional 3: formula type is a melting furnace)

// Removal formula needs to meet conditions 1, 2, or conditions 3 (popular translation into a recipe for removing blasting or melting furnace output iron ingots)

Event.remove ([{Type: 'Minecraft: SMELTING', OUTPUT: 'Minecraft: Iron_ingot'}, {Type: 'Minecraft: Blasting', Output: 'Minecraft: Iron _ingot '}])

// Remove the formula through the formula ID, data/mincraft/recipes/glowstone.json:

//Notice!Formula ID does not mean output items

event.remove ({ID: 'Minecraft: Glowstone'})

// The following is some examples of the author when using

// Remove the synthetic table with Anshan Case as the raw material

Event.remove ({Input: 'Create: Andesite_casing', Type: 'Minecraft: Crafting_Shaped'})

// The following is a simple cycle, which is used to remove the formula of a variety of plant basins

let color = ['cyan_glazed_terracotta',,

'Purple_glazed_terracotta',

'Blue_glazed_terracotta',,

'Brown_glazed_terracotta',

'Green_glazed_terracotta', 'Red_glazed_terracotta',

'Black_glazed_terracotta',

'Magenta_glazed_terracotta',

'Light_blue_glazed_terracotta',,

'YELLOW_GLAZED_TERRACOTTA',

'Lime_glazed_terracotta',,

'Pink_glazed_terracotta',,

'Gray_glazed_terracotta',,

'Light_gray_glazed_terracotta',,

'Orange_gray_glazed_terracotta',

'White_gray_glazed_terracotta'

]

for (let I of color) {

Event.remove ({input: `$ {i}`})

}

Formula replacement

Pay attention to the start of the start of the big bracket*

This part of the content allows you to modify some of the formula, rather than delete them one by one

Part of the magic change code from the author

 // event.replaceinput ({}, 'output item', 'input item') represents // {mod: 'extendedcrafting', output: 'extendedCrafting: Frame '} is usThe familiar formula screening is exactly the same as the previous part. This is the formula that screens the formula that meets the module as the synthetic expansion and the output is the formula as the black iron frame.

// 'ExtendedCrafting: Black_ioron_slate' is an output item, which is the black iron framework of synthetic expansion

// 'Mekanism: Steel_casing' is an input item. This is the steel shell of general machinery

Event.replaceinput ({mod: 'extendedcrafting', output: 'extendedcrafting: frame'},

'ExtendedCrafting: Black_iron_slate', 'Mekanism: Steel_casing'))

// This is another example, replacing all the satisfaction (the module is a thermal series, the synthesis method is orderly synthetic, not output iron ingot).

Event.replaceinpput ({mod: 'thermal', type: 'crafting_shaped', not: {output: 'thermal: IRON_GEAR'}}, '#Forge: Ingots/Iron', 'Botani a: manasteel_ingot ')

Create an orderly formula

The following is to create an orderly synthetic formula.Do not obsessed with orderly synthesis in order, try to try to replace the items in the formula, which may be simpler.

Example, still from the author

 // Orderly synthetic plant basins, use items for natural aura perfusion stone and original flower pots

// You only need to arrange the order of arrangement like the workbench. Pay attention to the place where there is no items instead.

//Item.of ('botanypots:Terracotta_botany_pot', 1) Represents the object plant basin, the quantity is 1

Event.shaped (item.of ('botanypots: terracotta_botany_pot', 1), [

'L l',

'LOL',

'L'

],,,

{{

L: 'naturesaura: Infused_stone',

O: Minecraft: Flower_pot '

}) // The soul of the birth of the natural aura module in an orderly synthesis

Event.shaped (item.of ('naturesaura: birth_spirit', 1), [

'QLQ',

'LOL',

'Qlq'

],,,

{{

L: 'Minecraft: amthyst_shard',

O: Minecraft: Diamond ',

Q: 'ARS_NOUVEAAA: SOURCESTONE'

})

The disorderly formula is the same. You only need to replace the shaped with shapeles. There is no need to place it into the form of Jiugongge. There is no instance here.

Other formula

Furnace formula event.smelting (output items, input items)

Blast furnace formula event.blasting (output item, input items)

Smoked furnace formula event.smoking (output item, input items)

Camp fire formula Event.campfireCooking (output items, input items)

Forging table formula event.smithing

Stone cutter formula event.stonecutting (output items, input items)

Auxiliary modules will add a similar format format, which can be found on the curseForge page corresponding to the module.

Some specific examples

 // Stone burned into 3 gravels

event.smelting ('3X Minecraft: Gravel', 'Minecraft: Stone')

// Boil the iron ingots into 10 iron grains (blast furnaces)

event.blasting ('10x mincraft: Iron_nugget', 'MINECRAFT: IRON_INGOT')

// Put the glass smoke into dyed glass

event.smoking ('Minecraft: Tinted_glass', 'Minecraft: Glass')

// Burn the wooden stick into a torch through the camp fire

Event.campfireCooking ('Minecraft: Torch', 'Minecraft: Stick')

// The following formula is not necessarily applicable in version 1.19.2, because mechanical power may change these items

// These magic reform integration packs from the author's previous magic reform

// Various items that use cases to synthesize mechanical power by using cases or stone cutting machines

// Forging desk

Event.smithing ('4x Create: Gearbox', 'Create: Andesite_casing', 'Create: Cogwheel'))

Event.smithing ('Create: SpeedMeter', 'Create: Andesite_casing', 'Minec Raft: Compass') Event.smithing (' Create: Millstone ',' Create: Andesite_ca Sing ','#Forge: Stone ')

Event.smithing ('Create: deployer', 'Create: Andesite_casing', 'Create: Brass_hand'))

Event.smithing ('Create: Mechanical_mixer', 'Create: Andesite_casing', 'Create: whisk'))

Event.smithing ('Create: Encased_fan', 'Create: Andesite_casing', 'Create: Propeller'))))

Event.smithing ('Create: Mechanical_press', 'Create: Andesite_casing', 'Minecraft: IRON_BLOCK')

Event.smithing ('Create: Mechanical_crafter', 'Create: Brass_casing', 'Create: Electron_tube'))

Event.smithing ('Create: Sequenced_gearshift', 'Create: Brass_casing', 'Create: Cogwheel'))

Event.smithing ('Create: Stockpile_switch', 'Create: Brass_casing', 'Minecraft: Comparator')

Event.smithing ('Create: Rotation_Speed_Controller', 'Create: Brass_casing', 'Create: Precision_MeChanism')

Event.smithing ('Create: Portable_storage_interface', 'Create: Brass_casing', 'Create: Andesite_funnel')

Event.smithing ('Create: Content_observer', 'Create: Copper_casing', 'Minecraft: Observer'))))

Event.smithing ('Create: Portable_fluid_interface', 'Create: Copper_casing', 'Create: Andesite_funnel')

Event.smithing ('Create: HOSE_PULLEY', 'Create: Copper_casing', 'Create: Fluid_pipe')))

Event.smithing ('Create: Item_drain', 'Create: Copper_casing', 'MINECRAFT: Iron_bars'))))

Event.smithing ('Create: Spout', 'Create: Copper_casing', 'Create: Copper_sheet') event.smithing ('Create: Fluid_tank', 'Create: Copper_casing', '#Forge: Glass')

//

Event.stoneCutting ('Create: Mechanical_saw', 'Create: Andesite_casing')

event.stonecutting ('4X Create: depot', 'Create: Andesite_casing')

Event.stoneCutting ('Create: Mechanical_drill', 'Create: Andesite_casing'))

event.stonecutting ('Create: Mechanical_bearing', 'Create: Andesite_casing'))

Event.stoneCutting ('Create: Gantry_carriage', 'Create: Andesite_casing'))

Event.stoneCutting ('16X Create: Analog_lever', 'Create: Andesite_casing')

Event.stoneCutting ('Create: Mechanical_piston', 'Create: Andesite_casing')

Event.stoneCutting ('4X Create: ENCASED_Chain_Drive', 'Create: Andesite_casing')

Event.stoneCutting ('Create: ROPE_PULLEY', 'Create: Andesite_casing')

Event.stoneCutting ('2x Create: Mechanical_plough', 'Create: Andesite_casing'))

Event.stoneCutting ('2x Create: Mechanical_harvester', 'Create: Andesite_casing'))

Event.stoneCutting ('2x Create: Clutch', 'Create: Andesite_casing')

Event.stoneCutting ('4x Create: Andesite_tunnel', 'Create: Andesite_casing')

Event.stoneCutting ('4X Create: Andesite_funnel', 'Create: Andesite_casing')

Event.stoneCutting ('4x Create: Brass_tunnel', 'Create: Brass_casing')

Event.stoneCutting ('4x Create: Brass_funnel', 'Create: Brass_casing')

Event.stoneCutting ('Create: Mechanical_arm', 'Create: Brass_casing')

Event.stoneCutting ('Create: CLOCKWORK_BEARING', 'Create: Brass_casing') event.stonecutting ('Create: nixie_tube', 'Create: Brass_casing')

Some special modifications

Special formula/synthesis method

The original special formula needs to be written into the format of the packet. After adding the subsidiaries, some synthesis can be used directly.

Mechanical power sequence assembly

Here are some examples of mechanical power sequence assembly. From the author, you need to be attached to

 // Create a flame cake

Event.recipes.create.sequenced_assembly ([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[

// Products:

Item.of ('Create: Creative_blaze_cake'). Withchance (32.0), // This is the weight

// Random waste:

Item.of ('Minecraft: Cake'). Withchance (2.0),

'CreateADDITION: chocolate_cake',

'CreateAdition: Honey_cake',

'Create: Blaze_cake',

],,,

// Enter the item:

'Minecraft: Cake',

[

// The formula of each step

Event.recipes.create.filling ('CreateADDITION: Cake_base', [

'CreateADITION: Cake_base',

FLUID.OF ('Minecraft: LAVA', 1000)

]), // Step 1 Injecting solution 1B magma

Event.recipes.create.pressing ('CreateADDITION: Cake_base', ['CreateadDition: Cake_base']), // Step 2

Event.recipes.create.filling ('CreateAdDition: Cake_base', ['CreateAdition: Cake_base',

Fluid.of ('CreateCafe: Oreo_tea', 250)

], // Step 3 Injecting solution 250MB Oreo milk tea, from mechanical power affiliated

Event.recipes.create.filling ('CreateADDITION: Cake_base', [

'CreateADITION: Cake_base',

FLUID.OF ('CreateadDition: BIOEThanol', 250)

]), // Step 4 Injecting solution 250MB of biological ethanol

]). Transitionalitem ('CreateadDition: Cake_base'). Loops (30) // The number of items and assembly times of the circular assembly, respectively

// drawer controller

Event.recipes.create.sequenced_assembly ([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[

// Products:

Item.of ('StorageDrawers: Controller'). Withchance (32.0),

// Random waste:

Item.of ('StorageDrawers: EMERALD_STORAGE_UPGRADE'). Withchance (2.0),

],,,

// Enter the item:

'StorageDrawers: Compacting_drawers_3',

[

// The formula of each step

Event.recipes.create.DepLoying ('StorageDrawers: Compacting_Drawers_3', [

'StorageDrawers: Compacting_drawers_3', 'StorageDrawers: EMERALD_STORAGE_UPGRADE'], //

Event.recipes.create.DepLoying ('StorageDrawers: Compacting_Drawers_3', [

'StorageDrawers: Compacting_drawers_3', 'Create: Precision_mechanism'

]), // Step 2 robotic hand

Event.recipes.create.DepLoying ('StorageDrawers: Compacting_Drawers_3', [

'StorageDrawers: Compacting_drawers_3', 'Create_things_and_misc: Vibration_MeChanism'

]), // Step 3 robotic hand

])..

// The bottle of time

Event.recipes.create.sequenced_assembly ([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[

// Products:

Item.of ('tiab: time_in_a_bottle'). Withchance (32.0),

// Random waste:

Item.of ('IRons_spellbooks: Lightning_bottle'). WithChaance (1.0),

],,,

// Enter the item:

'Minecraft: Glass_bottle',

[

// The formula of each step

Event.recipes.create.DepLoying ('MINECRAFT: Glass_bottle', [

'Minecraft: Glass_bottle', 'IRons_Spellbooks: Lightning_bottle'

]), // The first step of the robotic hand

event.recipes.create.DepLoying ('MINECRAFT: Glass_bottle', [

'Minecraft: Glass_bottle', 'Create: Precision_mechanism'

]), // Step 2 robotic hand

event.recipes.create.DepLoying ('MINECRAFT: Glass_bottle', [

'Minecraft: Glass_bottle', 'Create_things_and_misc: Vibration_MeChanism'

]), // Step 3 robotic hand

]). Transitionalitem ('Minecraft: Glass_bottle').

// Jiao oven brick

Event.recipes.create.sequenced_assembly ([// finished product: finished product:

Item.of ('ImmersiveEngineering: Cokebrick'), cokebrick '),

],,,

// Enter the item:

'Minecraft: bricks',

[

// The formula of each step

Event.recipes.create.DepLoying ('Minecraft: bricks', [

'Minecraft: bricks', 'naturesaura: GOLD_BRICK'

]), // Step 1

Event.recipes.create.DepLoying ('Minecraft: bricks', [

'Minecraft: bricks', 'naturesaura: Infused_brick'

]), // Step 2

Event.recipes.create.DepLoying ('Minecraft: bricks', [

'MINECRAFT: Bricks', 'Naturesaura: GOLD_NETHER_BRKK'

]), Step 3

Event.recipes.create.filling ('Minecraft: bricks', [

'Minecraft: bricks',

FLUID.OF ('PNEUMATICRAFT: lpg', 500)

]), // Step 4

]). Transitionalitem ('Minecraft: bricks'). Loops (30)

// Black furnace brick

Event.recipes.create.sequenced_assembly ([// finished product: finished product:

Item.of ('ImmersiveEngineering: Blastbrick'), Blastbrick '),

],,,

// Enter the item:

'ImmerSivengineering: cokebrick',

[

// The formula of each step

Event.recipes.create.DepLoying ('ImmersiveNGINEERING: Cokebrick', [

'ImmerSivengineering: cokebrick', 'Immersivengineering: Treated_wood_horizontal'

]), // Step 1

Event.recipes.create.DepLoying ('ImmersiveNGINEERING: Cokebrick', [

'ImmerSivengineering: cokebrick', 'Immersivengineering: Treated_wood_horizontal'

]), // Step 2

Event.recipes.create.DepLoying ('ImmersiveNGINEERING: Cokebrick', [

'ImmerSivengineering: cokebrick', 'Immersivengineering: Treated_wood_horizontal'

]), Step 3

Event.recipes.create.filling ('Immersivengineering: Cokebrick', [

'ImmerSivengineering: cokebrick',

FLUID.OF ('pneumaticCraft: biodiesel', 500)

]), // Step 4

]). Transitionalitem ('Immersivengineering: Cokebrick'). Loops (50)

// kiln brick

Event.recipes.create.sequenced_assembly ([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[

// Products:

Item.of ('ImmersiveEngineering: Alloybrick'),), alloybrick '),

],,,

// Enter the item:

'ImmerSivengineering: Treated_wood_horizontal',

[

// The formula of each step

event.recipes.create.deploying('immersiveengineering:treated_wood_horizontal',[    'immersiveengineering:treated_wood_horizontal','#forge:sandstone'

]), // Step 1

Event.recipes.create.DepLoying ('ImmersiveNGINEERING: Treated_wood_horizontal', [

'ImmerSiveNGINEERING: Treated_wood_horizontal', 'Naturalsaura: GOLD_NETHER_BRICK'

]), // Step 2

Event.recipes.create.DepLoying ('ImmersiveNGINEERING: Treated_wood_horizontal', [

'ImmerSiveNGINEERING: Treated_wood_horizontal', '#Forge: Sandstone'

]), Step 3

]). Transitionalitem ('Immersivengineering: Treated_wood_horizontal'). Loops (5) (5)

// Insulation attachment layer

Event.recipes.create.sequenced_assembly ([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[

// Products:

Item.of ('POWAH: DIELECTRIC_PASTE'),

],,,

// Enter the item:

'Minecraft: Blaze_powder',

[

// The formula of each step

Event.recipes.create.DepLoying ('MINECRAFT: Blaze_Powder', [

'Minecraft: Blaze_powder', 'Botania: Mana_powder'

]), // Step 1

Event.recipes.create.DepLoying ('MINECRAFT: Blaze_Powder', [

'Minecraft: Blaze_powder', 'Botania: Pixie_dust'], Step 2

Event.recipes.create.DepLoying ('MINECRAFT: Blaze_Powder', [

'Minecraft: Blaze_powder', 'Thermal: BASALZ_POWDER'

]), Step 3

Event.recipes.create.DepLoying ('MINECRAFT: Blaze_Powder', [

'Minecraft: Blaze_powder', 'Thermal: blitz_powder'

]), // Step 4

Event.recipes.create.DepLoying ('MINECRAFT: Blaze_Powder', [

'Minecraft: Blaze_powder', 'Thermal: blizz_powder'

]), // Step 5

])..

Industrial Pioneer Chemical dissolving room

The format is the data packet format, and does not need an attachment

*Refer to E6E's magic reform file*

e6e link E6E

const recipes = [

{{

Inputs: [// Input items

{'Item': 'POWAH: STEEL_ENERGIDIZED'}, {'item': 'IndustrialForegoing: Machine_frame_supreme'}, {'ittem': 'mysticaladDitys: Insanium_essence '},

{'Item': 'POWAH: STEEL_ENERGIDIZED'}, {'item': 'mysticalagradity: insanium_essence'}, {'ittem': Steel_ Energized '}, {' item ':' Industrialforegoing: Plastic '}, {'item ': mysticalagraddules: insanium_essence'},

],,,

Inputflum: 'Industrialforegoing: Ether_gas', // Input fluid

Inputfluidamount: 100, // Input the fluidum volume

Processingtime: 100, // consume time

OutputITEM: {item: 'mekanism: steel_casing'}, // output items, output volume

Outputflum: '', // Output fluid

Outputfluidamount: 0, // Output fluidum

ID: 'Mekanism: Steel_casing'

},

{{

Inputs: [// Input items

{'Item': 'Minecraft: WHEAT_SEEDS'}

], InputFluid: 'IndustrialForegoing: pink_slime', // Input fluid

Inputfluidamount: 100, // Input the fluidum volume

Processingtime: 10, // consume time

OutputITEM: {item: 'mysticalagriculture: Prosperity_seed_base'}, // Output items, output volume, output volume

Outputflum: '', // Output fluid

Outputfluidamount: 0, // Output fluidum

ID: 'mysticalagridulture: Prosperity_seed_base'

},

{{

Inputs: [// Input items

{'Item': 'Industrialforegoing: Plastic'}, {'item': 'my sticalagridure ng: Plastic '},

{'Item': 'IndustrialForeGoing: Plastic'}, {'Item': 'IndustrialForegoing: Plastic'},

{'Item': 'Industrialforegoing: Plastic'}, {'Item': 'IndustrialForegoing: Hydroponic_bed'}, {'ittem': 'IndustrialForegoing: Plast IC '},],

Inputflum: 'Industrialforegoing: Ether_gas', // Input fluid

Inputfluidamount: 1000, // Input the fluid amount

Processingtime: 1500, // consume time

OutputITEM: {item: 'mysticalagriculture: infusion_altar'}, // output items, output volume

Outputflum: '', // Output fluid

Outputfluidamount: 0, // Output fluidum

ID: 'mysticalagridult: infusion_altar'

},

{{

Inputs: [// Input items

{'Item': 'minecraft: Iron_INGOT'}, {'item': 'ae2: black_lumen_paint_ball'},

],,,

InputFlum: 'IndustrialForegoing: Ether_GAS', // Input fluid InputFluidamount: 10, // Input the fluidum amount

Processingtime: 150, // consume time

OutputITITEM: {item: 'extendedcrafting: black_iron_ingot'}, // output items, output volume

Outputflum: '', // Output fluid

Outputfluidamount: 0, // Output fluidum

ID: 'ExtendedCrafting: Black_ioron_INGOT'

},

{{

Inputs: [// Input items

{'Item': 'Industrialforegoing: pink_slime_ingot'}, {'Item': 'EXTENDEDCRAFTING: PEDESTAL'}, {'Item': 'IndustrialForegoing: pink: pink _slime_ingot '},

{'Item': 'Industrialforegoing: pink_slime_ingot'}, {'Item': 'Indrialforegoing: pink_slime_ingot'},

{'Item': 'Industrialforegoing: pink_slime_ingot'}, {'Item': 'Industrialforegoing: pink_slime_ingot'}, {'ITEM': 'Industrialfore Going: pink_slime_ingot '},],

InputFlum: 'Industrialforegoing: Pink_slime', // Input fluid

Inputfluidamount: 100, // Input the fluidum volume

Processingtime: 150, // consume time

OutputITEM: {item: 'mysticalagriculture: infusion_pedestal'}, // output items, output volume, output volume

Outputflum: '', // Output fluid

Outputfluidamount: 0, // Output fluidum

ID: 'mysticalagridult: infusion_pedestal'

}

];

Recipes.Foreach ((recipe) => {

Let Ingredients = [];

Recipe.inputs.Foreach ((input) => {{

Ingredients.push (Ingredient.of (input));

});

Event.custom ({{

Type: 'Industriboregoing: DISSOLUTION_CHAMBER',

Input: Ingredients,

InputFlump: `{Fluidname:" $ {recipe.inputfluid} ", amount: $ {recipe.inputfluidamount}`,

Processingtime: recipe.processingtime,

Output: recipe.outputITEM,

Outputfluid: `{FLUIDNAME:" $ {recipe.outputfluid} ", amount: $ {recipe.outputfluidamount}` `` `` `` `` `` `` `` `` `` `` `` `

})

.Id (recipe.id);

})

Natural aura forest ceremony

Data packet modification, no attachment is required

Enter the format of the item to use the format of the example. Other methods are very easy to report errors. Do not ask me how to know

 // Written as {'item': 'create: creative_blaze_cake'} instead of 'Create: Creative_blaze_cake'!

event.custom (

{{

"Type": "Naturesaura: Tree_ritual",

"Ingredients": [// Enter items, up to 8 kinds

{'Item': 'Create: Creative_blaze_cake'}, {'item': 'create: precision_mechanism'},

{'Item': 'Create_things_and_misc: Vibration_Mechanism'},

{'Item': 'naturesaura: token_joy'},

{'Item': 'naturesaura: token_fear'},

{'Item': 'naturesaura: token_anger'},

{'Item': 'naturesaura: token_sorrow'},

{'Item': 'Create: Experience_nugget'}

],,,

"Sapling": {

"Item": "Minecraft: Oak_sapling" // The required sapling

},

"Output": {"item": 'naturesaura: nature_altar', // products

"Count": 1

},

"Time": 100 // The time required for the ceremony

}

Cure

Event.custom (

{{

"Type": "Naturesaura: Tree_ritual",

"Ingredients": [// Enter items, up to 8 kinds

{'Item': 'naturesaura: Sky_INGOT'},

{'Item': 'naturesaura: sky_ingot'}, {'item': 'naturesaura: sky_ingot'},

{'Item': 'naturesaura: Sky_INGOT'},

{'Item': 'naturesaura: token_euphoria'}

],,,

"Sapling": {

"Item": "Minecraft: Oak_sapling" // The required sapling

},

"OUTPUT": {

"Item": 'naturesaura: Animal_spawner', // Products

"Count": 1},

"Time": 100 // The time required for the ceremony

}

Cure

Event.custom (

{{

"Type": "Naturesaura: Tree_ritual",

"Ingredients": [// Enter items, up to 8 kinds

{'Item': 'naturesaura: Sky_INGOT'},

{'Item': 'naturesaura: incused_iron'},

{'Item': 'naturesaura: token_euphoria'}, {'item': 'naturesaura: token_terror'},

{'Item': 'naturesaura: token_rage'},

{'Item': 'naturesaura: token_grief'},

{'Item': 'naturesaura: infused_stone'}

],,,

"Sapling": {

"Item": "Minecraft: Oak_sapling" // The required sapling

},

"OUTPUT": {

"Item": 'naturesaura: conventivity_catalyst', // Product "Count": 1

},

"Time": 100 // The time required for the ceremony

}

Cure

Event.custom (

{{

"Type": "Naturesaura: Tree_ritual",

"Ingredients": [// Enter items, up to 8 kinds

{'Item': 'naturesaura: Sky_INGOT'},

{'Item': 'naturesaura: incused_iron'}, {'item': 'naturesaura: token_euphoria'},

{'Item': 'naturesaura: token_terror'},

{'Item': 'naturesaura: token_rage'},

{'Item': 'naturesaura: token_grief'},

{'Item': 'naturesaura: infused_brick'}

],,,

"Sapling": {

"Item": "Minecraft: Oak_sapling" // The required sapling

},

"OUTPUT": {

"Item": 'naturesaura: crushing_catalyst', // Product "Count": 1

},

"Time": 100 // The time required for the ceremony

}

Cure

Event.custom (

{{

"Type": "Naturesaura: Tree_ritual",

"Ingredients": [// Enter items, up to 8 kinds

{'Item': 'Art_nouveau: SourceStone'},

{'Item': 'Art_nouveau: SourceStone'},

{'Item': 'ARS_NOUVEAU: SOURCE_GEM'}, {'Item': 'Art_nouveau: Source_gem'},

{'Item': 'Art_nouveau: Source_gem_block'},

{'Item': 'Art_nouveau: Source_gem_block'},

{'Item': 'naturesaura: calling_spirit'}

],,,

"Sapling": {

"Item": "Minecraft: Oak_sapling" // The required sapling

},

"OUTPUT": {

"It": 'art_nouveau: Imbuement_chamber', // Product "Count": 1

},

"Time": 100 // The time required for the ceremony

}

Cure

Event.custom (

{{

"Type": "Naturesaura: Tree_ritual",

"Ingredients": [// Enter items, up to 8 kinds

{'Item': 'naturesaura: incused_iron'},

{'Item': 'naturesaura: Sky_INGOT'},

{'Item': 'naturesaura: tainted_gold'}, {'item': 'naturesaura: depth_ingot'},

{'Item': 'Art_nouveau: Imbuement_chamber'}

],,,

"Sapling": {

"Item": "Minecraft: Oak_sapling" // The required sapling

},

"OUTPUT": {

"Item": 'ARS_NOUVEAU: Enchanting_appratus', // Products

"Count": 1

},

"Time": 100 // The time required for the ceremony

}

)

Advanced and Supplement

Define function (functional programming)

We first go back to the basic framework:

And try to write our first function

<<<<<<] = "assh: none;">> serverersion

let functions1 = (a, b, c) => {

Event.smithing (A, B, C)

}

})

Among them, A, B, C are all variables, we can call this function we just defined by the following method:

 Function1 ('Minecraft: Netherite', 'Minecraft: Bone_meal', 'Minecraft: Cake') 

This expression is equivalent

 Event.smithing ('Minecraft: Netherite', 'MINECRAFT: BONE_MEAL', 'MINECRAFT: Cake') 

Now, you may have a question: it seems that this method does not seem to be necessary, but there can be a lot of things in it, that is, the modular programming that many people now say.

Now we have this method of functional programming, but we will feel nowhere. This is because it is just that the editing synthesis table is not enough to give play to its advantages.

Many times, we want to get rid of the pile of the synthetic table to do something new. At this time, we need to use the ability of the above -defined function.

In the next section, we will give a specific instance and realize this example by step to tell how to define a function by ourselves.

"Single" block empty island starting from zero

Previously, there was a very popular theme that there was a regular refresh block in the empty island. Now we try to get rid of the MOD to use Kubejs to achieve it.

The first step to realize a complete function is to finalize the outline:

1. How long is it refreshed?

2. The refresh box range?

3. Refresh position?

Let's first solve these three basic problems:

How long does it refresh: We set as 60s, so what method should we use to get the current time?

First of all, we need to consider the method provided from Kubejs: By consulting the official wiki, we found this function

 levelevents.tick () // Divide clienetevents.tick, the latter is the client tick 

So we naturally write it and define the time variable time

 levelevents.tick (event => {

Const time = event.level.gettime ()

}

However, we found that the Time variable unit obtained in this way is GameTick (GT, 1s = 20GT), and now we need to convert

 var n = 0 // Don't forget to give him a value before using variables .levelevents.tick (event => {{{{{

Const time = event.level.gettime ()

VAR SEC = Math.floor (n/5) // Tarze down to ensure that the SEC should be an integer. The SEC variable represents the current second

If (time%20 == 0) {// In JS%represents the balance, for example, 16%3 = 1, that is, 16 = 3*5+1

N ++ // This function is circulated once in this function once, so there is no need to write another cycle structure

}

}

If there is a programming foundation, it is easy to understand the above content. For those who have no programming foundation, you can refer to the following process:

Tick ​​= 1-> SEC = Floor (0/5) = 0-> TIME%20 = 1 is not equal to 0 (then using computer language TIME%20! = 0) -> N Naruts-> tick = tick+1 (tick = 2)-> ...

Next we need to make a round of judgment. If the number of seconds is equal to 60s, the block is updated:

 var n = 0 // Don't forget to give him a value before using variables.

Levelevents.Tick (event => {{

Const time = event.level.gettime ()

VAR SEC = Math.floor (n/5) // Tarze down to ensure that the SEC should be an integer. The SEC variable represents the current second

If (time%20 == 0) {// In JS%represents the balance, for example, 16%3 = 1, that is, 16 = 3*5+1

N ++ // This function is circulated once in this function once, so there is no need to write another cycle structure

}

If (60-time == 0) {{

NUM = 0 // Refine counter

}

}

2. Let's solve the next problem, how to specify the refresh range.

For high school students, you can think of a collection, we put items that can be refreshed in a collection.

For most of the majors of college students, I have learned a programming language more or less, and apply the array you understand.

We need to define a large array

 const block = ['MINECRAFT: Copper_block', 'Minecraft: Enchanting_table', 'Minecraft: TNT'] // Only wrote 3 

Now we need to realize random generation. Here we only need to convert one element in random extraction array (of course, we can find that stored multiple elements in the array will increase the probability of being drawn))

 const r = math.floor (math.random ()*block.length) // rate () to generate a random number of [0,1], followed by array size 

3. How to refresh: We only need to use the instruction:

 Event.server.runcommandsilent (`setBlock 0 65 0 $ {block [r]`) 

Now let's comprehensively take the code to get the finished product:

 var n = 0 // Don't forget to give him a value before using variables.

const block = ['mincrft: Copper_block', 'MINECRAFT: Enchanting_table', 'MINECRAFT: TNT'] //

Levelevents.Tick (event => {{

Const time = event.level.gettime ()

VAR SEC = Math.floor (n/5) // Tarze down to ensure that the SEC should be an integer. The SEC variable represents the current second

If (time%20 == 0) {// In JS%represents the balance, for example, 16%3 = 1, that is, 16 = 3*5+1

N ++ // This function is circulated once in this function once, so there is no need to write another cycle structure

}

If (60-time == 0) {{

const R = math.floor (math.random ()*block.length) // Random () can generate a random number of [0,1], followed by the array size .Server.runcommandsilent (`setBlock 0 65 0 $ {block [r] `)

NUM = 0 // Refine counter

}

}

Now we can think about how to provide more options, such as adding stage limits, generating entities, changing the refresh time, multiple refresh points expansion ...

This question is determined by you. This instance can be used as a finger stone for you to open the new world.

The next section of the preview: the operation and change of the label.

at last

There are many places that need to be perfected in this tutorial, and it may be updated afterwards. If you have any questions, you can comment on a message.

Remove the final batch operation of the small chapter, because it completes a more complete tutorial.

Custom items, cubes, Kubejs events may be updated