Appearance
helix / RecipeDef
Class: RecipeDef
Defined in: core/values/recipe.ts:45
A registerable recipe - the JSON written to data/<ns>/<recipe folder>/<name>.json (via Datapack.recipe). Built from typed ItemValue/IdValue ingredients, rendered version-aware (the 1.20.5 ingredient/result format change is handled for you).
dp.recipe("ruby_block", RecipeDef.shaped( ["###", "###", "###"], { "#": Item.of("mypack:ruby") }, Item.of("mypack:ruby_block")));
Methods
toJson()
toJson(
version):Record<string,unknown>
Defined in: core/values/recipe.ts:49
The recipe JSON, with embedded ingredients rendered for version.
Parameters
version
Returns
Record<string, unknown>
cooking()
staticcooking(ingredient,result,opts?):RecipeDef
Defined in: core/values/recipe.ts:83
A cooking recipe: minecraft:smelting (default), blasting, smoking, or campfire_cooking. experience/cookingtime default to 0.1 / 200.
Parameters
ingredient
result
opts?
cookingtime?
number
experience?
number
type?
"smelting" | "blasting" | "smoking" | "campfire_cooking"
Returns
RecipeDef
of()
staticof(type,fields):RecipeDef
Defined in: core/values/recipe.ts:127
Escape hatch: a recipe by type id with already-built fields.
Parameters
type
string
fields
Record<string, unknown>
Returns
RecipeDef
shaped()
staticshaped(pattern,key,result,count?):RecipeDef
Defined in: core/values/recipe.ts:54
minecraft:crafting_shaped - a grid pattern keyed by single-char ingredients.
Parameters
pattern
string[]
key
Record<string, Ingredient>
result
count?
number = 1
Returns
RecipeDef
shapeless()
staticshapeless(ingredients,result,count?):RecipeDef
Defined in: core/values/recipe.ts:71
minecraft:crafting_shapeless - an unordered list of ingredients.
Parameters
ingredients
result
count?
number = 1
Returns
RecipeDef
smithingTransform()
staticsmithingTransform(template,base,addition,result):RecipeDef
Defined in: core/values/recipe.ts:111
minecraft:smithing_transform - template + base + addition → result (1.20+ smithing).
Parameters
template
base
addition
result
Returns
RecipeDef
stonecutting()
staticstonecutting(ingredient,result,count?):RecipeDef
Defined in: core/values/recipe.ts:102
minecraft:stonecutting - one ingredient to count of a result.
Parameters
ingredient
result
count?
number = 1
Returns
RecipeDef