-
Notifications
You must be signed in to change notification settings - Fork 0
Minecraft Functions
Functions for creating recipes and modifying data using Minecraft's native recipe systems through KubeJS.
Creates a Minecraft smelting recipe.
-
Machine: furnace.
-
Output: a single item.
-
Input: a single ingredient.
-
Experience: amount of experience granted when the recipe is completed.
-
Time: cooking time defined in ticks.
-
Typical use:
raw iron → iron ingot. -
Code:
smelting(
e,
itemOutput("minecraft:iron_ingot"),
itemInput("minecraft:raw_iron"),
0.7,
200
);Creates a Minecraft blasting recipe.
-
Machine: blast furnace.
-
Output: a single item.
-
Input: a single ingredient.
-
Experience: amount of experience granted when the recipe is completed.
-
Time: cooking time defined in ticks.
-
Typical use:
raw iron → iron ingot. -
Code:
blasting(
e,
itemOutput("minecraft:iron_ingot"),
itemInput("minecraft:raw_iron"),
0.7,
100
);Creates a Minecraft smoking recipe.
-
Machine: smoker.
-
Output: a single item.
-
Input: a single ingredient.
-
Experience: amount of experience granted when the recipe is completed.
-
Time: cooking time defined in ticks.
-
Typical use:
beef → cooked beef. -
Code:
smoking(
e,
itemOutput("minecraft:cooked_beef"),
itemInput("minecraft:beef"),
0.35,
100
);Creates a Minecraft shaped crafting recipe.
-
Machine: crafting table.
-
Output: a single item or stack.
-
Inputs: ingredients assigned to pattern keys.
-
Pattern: grid of strings representing the crafting pattern.
-
Typical use: recipes where the position of the ingredients matters.
-
Code:
shaped(
e,
itemOutput("minecraft:iron_pickaxe"),
Object.assign(
{},
itemInputKey("A", "minecraft:iron_ingot"),
itemInputTagKey("B", "c:rods/wooden")
),
[
"AAA",
" B ",
" B "
]
);Creates a Minecraft shapeless crafting recipe.
-
Machine: crafting table.
-
Output: a single item or stack.
-
Inputs: multiple ingredients.
-
Order: the position of the ingredients does not matter.
-
Typical use: recipes where ingredients can be placed in any position.
-
Code:
shapeless(
e,
itemOutput("minecraft:stick"),
[
itemInput("minecraft:planks"),
itemInput("minecraft:planks")
]
);Creates a Minecraft stonecutting recipe.
-
Machine: stonecutter.
-
Output: a single item.
-
Input: a single ingredient.
-
Typical use:
stone → stone slab. -
Code:
stonecutting(
e,
itemInput("minecraft:stone"),
itemOutput("minecraft:stone_slab")
);Creates a Minecraft smithing transformation recipe.
-
Machine: smithing table.
-
Output: a single item.
-
Template: smithing template ingredient.
-
Base: item being upgraded or transformed.
-
Addition: additional ingredient used in the transformation.
-
Typical use:
diamond sword + netherite upgrade + netherite ingot → netherite sword. -
Code:
smithing(
e,
itemOutput("minecraft:netherite_sword"),
itemInput("minecraft:netherite_upgrade_smithing_template"),
itemInput("minecraft:diamond_sword"),
itemInput("minecraft:netherite_ingot")
);Adds items to a Minecraft item tag.
-
Type: item tag modification.
-
Tag: identifier of the item tag to modify.
-
Items: list of item identifiers to add to the tag.
-
Typical use: adding custom or modded items to existing item tags.
-
Code:
addTag(
e,
"c:ingots/iron",
[
"minecraft:iron_ingot",
"examplemod:iron_ingot"
]
);