Recipe serializer

Helpers that build a minecraft:recipe_serializer object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. Click a type to see what it accepts.

Blasting

Blasting
Blasting(ingredient, result, cookingtime, show_notification?, group?, category?, experience?)
ingredient
Ingredient
result
ItemStackTemplate
cookingtime
int

Hint: The "Normal" value for this is 200.

show_notificationoptional
bool

Determines if a notification is shown when unlocking this recipe. Defaults to true.

groupoptional
string

Identifier to group multiple recipes in the recipe book.

categoryoptional
CookingBookCategory

Identifier for the category this goes in the recipe book.

experienceoptional
number

Brewing

Brewing
Brewing(input, reagent, output)
input
PotionIngredient

The original potion.

reagent
PotionIngredient

The ingredient.

output
ItemStackTemplate

CampfireCooking

CampfireCooking
CampfireCooking(ingredient, result, cookingtime, show_notification?, group?, category?, experience?)
ingredient
Ingredient
result
ItemStackTemplate
cookingtime
int

Hint: The "Normal" value for this is 200.

show_notificationoptional
bool

Determines if a notification is shown when unlocking this recipe. Defaults to true.

groupoptional
string

Identifier to group multiple recipes in the recipe book.

categoryoptional
CookingBookCategory

Identifier for the category this goes in the recipe book.

experienceoptional
number

CraftingDecoratedPot

CraftingDecoratedPot
CraftingDecoratedPot(back, left, right, front, result)
back
Ingredient
left
Ingredient
right
Ingredient
front
Ingredient
result
ItemStackTemplate

The pot_decorations component will store the 4 ingredients.

CraftingDye

CraftingDye
CraftingDye(target, dye, result, show_notification?, group?, category?)
target
Ingredient

The item to be dyed. Its dyed_color component will be dyed. The other components are copied.

dye
Ingredient

The items to provide dye color. Colors are provided by the dye component. Multiple dyes can be used at the same time.

result
ItemStackTemplate
show_notificationoptional
bool

Determines if a notification is shown when unlocking this recipe. Defaults to true.

groupoptional
string

Identifier to group multiple recipes in the recipe book.

categoryoptional
CraftingBookCategory

Identifier for the category this goes in the recipe book.

CraftingImbue

CraftingImbue
CraftingImbue(source, material, result, show_notification?, group?, category?)
source
Ingredient

The item to provide potion effect. Its potion_contents component will be copied. This item is placed at the center grid.

material
Ingredient

Additional ingredients. 8 material items are required to surroud the source item.

result
ItemStackTemplate
show_notificationoptional
bool

Determines if a notification is shown when unlocking this recipe. Defaults to true.

groupoptional
string

Identifier to group multiple recipes in the recipe book.

categoryoptional
CraftingBookCategory

Identifier for the category this goes in the recipe book.

CraftingSpecialBannerduplicate

CraftingSpecialBannerduplicate
CraftingSpecialBannerduplicate(banner, result)
banner
Ingredient

The banner item. The item type is required to be BannerItem. Exactly 2 banners of the same color are required. The one with patterns is viewed as "source". Its components will be copied. The other is viewed as "target". It is required to have no patterns. The source banner will be kept in the crafting grid.

result
ItemStackTemplate

CraftingSpecialBookcloning

CraftingSpecialBookcloning
CraftingSpecialBookcloning(source, material, result, allowed_generations?)
source
Ingredient

The book item. Its written_book_contents component will be copied, with generation value increased by 1. The other components are copied as-is. The book will be kept in the crafting grid.

material
Ingredient

Additional ingredients. Multiple materials can be used at the same time. The number of materials beyond the first one will be added to the result count.

result
ItemStackTemplate
allowed_generationsoptional
MinMaxBounds of int 0..2

Limits the generation of the source item that can be copied. Defaults to allow generation 0 and 1 (original and first copy).

CraftingSpecialFireworkRocket

CraftingSpecialFireworkRocket
CraftingSpecialFireworkRocket(shell, fuel, star, result)
shell
Ingredient

Additional ingredient. Exactly 1 additional ingredient is required.

fuel
Ingredient

The fuel ingredient. The count of fuel ingredients controls the flight_duration field. Only 1 ~ 3 fuels are allowed.

star
Ingredient

The firework star ingredient. Provides explosion data by the firework_explosion component. Any count of stars (including 0) are allowed.

result
ItemStackTemplate

The fireworks component is controlled by fuel and star.

CraftingSpecialFireworkStar

CraftingSpecialFireworkStar
CraftingSpecialFireworkStar(trail, twinkle, fuel, dye, shapes, result)
trail
Ingredient

If this ingredient is provided, the result will have has_trail field set.

twinkle
Ingredient

If this ingredient is provided, the result will have has_twinkle field set.

fuel
Ingredient

Additional ingredient. Exactly 1 additional ingredient is required.

dye
Ingredient

The items to provide explosion color. Colors are provided by the dye component. Multiple dyes can be used at the same time.

shapes
map of FireworkShape to Ingredient

If one of the ingredients is provided, the result will have the corresponding shape value. If no shape ingredient is provided, the shape will be small_ball.

result
ItemStackTemplate

The firework_explosion component is controlled by the ingredients.

CraftingSpecialFireworkStarFade

CraftingSpecialFireworkStarFade
CraftingSpecialFireworkStarFade(target, dye, result)
target
Ingredient

The firework star item. The fade effect of its firework_explosion will be changed. The other components are copied.

dye
Ingredient

The items to provide fade color. Colors are provided by the dye component. Multiple dyes can be used at the same time.

result
ItemStackTemplate

CraftingSpecialMapextending

CraftingSpecialMapextending
CraftingSpecialMapextending(map, material, result)
map
Ingredient

The map item. The map_id component is used to determine the resulting item. The other components are copied. This item is placed at the center grid. The source map will be kept in the crafting grid.

material
Ingredient

Additional ingredients. 8 material items are required to surroud the map item.

result
ItemStackTemplate

The previewing result will have map_post_processing transient component. The crafted result will have a new map_id component, which shows the extended version of the original map.

CraftingSpecialRepairitem

CraftingSpecialRepairitem
CraftingSpecialRepairitem()

CraftingSpecialShielddecoration

CraftingSpecialShielddecoration
CraftingSpecialShielddecoration(target, banner, result)
target
Ingredient

The item to be decorated. It is required to have no patterns. Its components, except base_color and banner_patterns, are copied.

banner
Ingredient

The banner item. The item type is required to be BannerItem. Determines the base_color component of the resulting item.

result
ItemStackTemplate

CraftingTransmute

CraftingTransmute
CraftingTransmute(input, material, result, show_notification?, group?, category?, material_count?, add_material_count_to_result?)
input
Ingredient

The ingredient that will transfer its data components to the result item.

material
Ingredient

An additional ingredient.

result
TransmuteResult | item id

The result item that will be merged with the input ingredient.

show_notificationoptional
bool

Determines if a notification is shown when unlocking this recipe. Defaults to true.

groupoptional
string

Identifier to group multiple recipes in the recipe book.

categoryoptional
CraftingBookCategory

Identifier for the category this goes in the recipe book.

material_countoptional
MinMaxBounds of int 1..8

The allowed count of material. Defaults to 1.

add_material_count_to_resultoptional
bool

When true, the number of materials will be added to the result count. Defaults to false.

Shaped

Shaped
Shaped(pattern, key, result)
pattern
list of string (1 to 3) (1 to 3)
key
map of string to Ingredient
result
ItemStackTemplate

Shapeless

Shapeless
Shapeless(ingredients, result)
ingredients
list of Ingredient (1 to 9)
result
ItemStackTemplate

Smelting

Smelting
Smelting(ingredient, result, cookingtime, show_notification?, group?, category?, experience?)
ingredient
Ingredient
result
ItemStackTemplate
cookingtime
int

Hint: The "Normal" value for this is 200.

show_notificationoptional
bool

Determines if a notification is shown when unlocking this recipe. Defaults to true.

groupoptional
string

Identifier to group multiple recipes in the recipe book.

categoryoptional
CookingBookCategory

Identifier for the category this goes in the recipe book.

experienceoptional
number

SmithingTransform

SmithingTransform
SmithingTransform(base, result, show_notification?, addition?, template?)
base
Ingredient

Ingredient specifying an item to be transformed.

result
ItemStackTemplate

Resulting transformed item.

show_notificationoptional
bool

Determines if a notification is shown when unlocking this recipe. Defaults to true.

additionoptional
Ingredient

Material that will be used.

templateoptional
Ingredient

Template item that will be used for the pattern.

SmithingTrim

SmithingTrim
SmithingTrim(base, addition, template, pattern, show_notification?)
base
Ingredient

Ingredient specifying an item to be trimmed.

addition
Ingredient

Material that will be used.

template
Ingredient

Template item that will be used for the pattern.

pattern
trim_pattern id

The trim pattern to apply to the result item.

show_notificationoptional
bool

Determines if a notification is shown when unlocking this recipe. Defaults to true.

Smoking

Smoking
Smoking(ingredient, result, cookingtime, show_notification?, group?, category?, experience?)
ingredient
Ingredient
result
ItemStackTemplate
cookingtime
int

Hint: The "Normal" value for this is 200.

show_notificationoptional
bool

Determines if a notification is shown when unlocking this recipe. Defaults to true.

groupoptional
string

Identifier to group multiple recipes in the recipe book.

categoryoptional
CookingBookCategory

Identifier for the category this goes in the recipe book.

experienceoptional
number

Stonecutting

Stonecutting
Stonecutting(ingredient, result, show_notification?)
ingredient
Ingredient
result
ItemStackTemplate
show_notificationoptional
bool

Determines if a notification is shown when unlocking this recipe. Defaults to true.