Skip to content

API reference / @jsprismarine/recipes

@jsprismarine/recipes ​

The Java Edition recipe evaluator. It reads Java 26.3 recipe files, matches them against what a player has placed at a station, and compiles them to Bedrock identifiers for the wire. It holds no registry of its own: tags, crafting remainders, item durability and dye colors all arrive through injected lookups.

ts
import { compileRecipes, loadRecipes } from '@jsprismarine/recipes';
import { javaItemToBedrock } from '@jsprismarine/mapping';

const { book, diagnostics, failed } = loadRecipes(definitions.recipesJava, {
    tags: (registry, tag) => registryTags[registry]?.get(tag),
    remainderOf: (id) => items.get(id)?.components['minecraft:crafting_remainder'],
    maxDamageOf: (id) => items.get(id)?.components['minecraft:max_damage'],
    dyeColorRgb: (color) => DYE_COLORS[color]
});

book.match({ station: 'crafting', grid });
// { recipe, result, consumed, remainder }

compileRecipes(book.recipes, javaItemToBedrock);
// { recipes, losses, gaps, dropped }

Coverage ​

All 22 serializers Java 26.3 registers, verified against net.minecraft.world.item.crafting.RecipeSerializers in the 26.3 server jar and against the 2042 vanilla recipe files, which use every one of them.

SerializerVanilla filesStationLogic
crafting_shaped827craftingpattern, mirrored and offset
crafting_shapeless375craftingingredient-to-slot assignment
stonecutting351stonecuttingone item in, one out
brewing279brewinginput plus reagent, with a potion predicate on the input
smelting73smeltingone item, experience and cook time
crafting_transmute33craftingcode: input keeps its components, material is counted
blasting25blastingone item
smithing_trim18smithingcode: writes minecraft:trim onto the base
crafting_special_bannerduplicate16craftingcode: copies patterns, returns the source banner
smithing_transform12smithingbase components carry into the result
smoking9smokingone item
campfire_cooking9campfire_cookingone item
crafting_dye6craftingcode: averages dye colors the way DyedItemColor.applyDyes does
crafting_decorated_pot1craftingcode: four sherds at the edge-center slots
crafting_imbue1craftingcode: eight materials around one source, which carries its potion
crafting_special_bookcloning1craftingcode: one copy per blank book, generation plus one
crafting_special_firework_rocket1craftingcode: flight duration from the fuel count
crafting_special_firework_star1craftingcode: shape, colors, trail and twinkle
crafting_special_firework_star_fade1craftingcode: adds fade colors to an existing explosion
crafting_special_mapextending1craftingcode: marks the centered map for rescaling
crafting_special_repairitem1craftingcode: combined durability plus five percent
crafting_special_shielddecoration1craftingcode: banner color and patterns onto a shield

What 26.3 moved out of crafting_special_* ​

Older notes list armor dyeing, map cloning, shulker box coloring, tipped arrows and suspicious stew among the code-only recipes. In 26.3 they are not. Armor dyeing is crafting_dye, tipped arrows are crafting_imbue, map cloning and shulker box and bundle dyeing are crafting_transmute, and all 17 suspicious stew recipes are plain crafting_shapeless with the effect in the result's minecraft:suspicious_stew_effects component. The eight serializers whose name still starts with crafting_special_ are the eight in the table above, which is the same eight java-registries-and-components.md section 8 lists. Four more types are code behind a parameterized file (crafting_transmute, crafting_dye, crafting_imbue, crafting_decorated_pot), so twelve of the 22 need a real implementation rather than a field read.

Ingredient forms ​

All four composition forms Java 26.3 accepts: an item identifier, a #tag, a list of either, and an inline object naming an item plus component predicates. Vanilla uses the inline form only for the 279 brewing recipes, where it carries a potion_contents predicate; that predicate is implemented against the potion registry, and any other inline component is compared structurally against the candidate stack's component of the same name.

What is not here ​

Recipe book unlocking, the recipe advancement criteria, and the Bedrock priority field, which has no Java source. Brewing matches one bottle slot at a time; the three-slot brewing stand loop belongs to the block entity.

The injected seams ​

Parsing and matching read four lookups, all optional, all on RecipeContext. Each one says what stops working when it is missing, because a caller can start with none of them.

LookupUsed byWithout it
tags(registry, tag)every #tag ingredient, at parse timethe ingredient accepts nothing and parsing warns
remainderOf(itemId)the craft's leftoversa milk bucket or a honey bottle vanishes into the craft
maxDamageOf(itemId)crafting_special_repairitemthe repair recipe never matches, because damageability is what it tests
dyeColorRgb(color)crafting_dye, the two firework star recipesdyed armor keeps its old color and a star records none

Tags resolve at parse time, which is where Java resolves them: reloading tags means reparsing the recipes.

The Bedrock side is a fifth seam. compileRecipes(recipes, mapper) takes the item mapper as an argument rather than importing one, so this package has no runtime dependency on @jsprismarine/mapping. That package's javaItemToBedrock satisfies the JavaItemMapper type structurally, and the tests here run against it as a dev dependency.

Compiling reports rather than drops. A reviewed loss keeps the recipe and is listed in losses with the mapper's reason. An identifier with no Bedrock item at all is listed in gaps; it costs the recipe only when it is the result or when it empties an ingredient, and those recipes are named in dropped. Each compiled recipe also carries the Bedrock block tags its station needs (crafting_table, furnace, blast_furnace, smoker, campfire and soul_campfire, stonecutter, smithing_table, brewing_stand), taken from the tags the vanilla Bedrock pack's own recipe files carry.

Matching ​

A crafting grid is cropped to the bounding box of its filled slots before any recipe sees it, which is what Java's CraftingInput.ofPositioned does and what lets a 2x2 recipe match in any corner of a 3x3 table. The shaped pattern is trimmed the same way when the recipe is parsed, matching ShapedRecipePattern.shrink; seven vanilla recipes, spyglass and mace among them, are written with padding columns and would otherwise be wider than any grid they can see. The pattern is then tried at every remaining offset and in both the written and the left-right mirrored arrangement. Shaped recipes are always mirrorable and never vertically flippable.

A match reports consumed and remainder per input slot in the input's own slot order. Both carry the full grid, not the cropped one. consumed is one per filled slot. remainder is what the slot gains afterwards: the item's crafting remainder, or the source stack that banner duplication and book cloning hand back.

Ordering and network ids ​

orderRecipes sorts by namespace first, then by path, comparing UTF-16 code units rather than collating. localeCompare puts the same two identifiers in different orders on different machines, and the plan takes recipe network ids from registry order, so the order has to be a pure function of the loaded identifiers. Load order, file system order and insertion order are all excluded for the same reason.

assignNetIds numbers the sorted list from 1, because Bedrock reserves 0 for "no recipe". Adding a recipe renumbers everything that sorts after it, so a client has to be sent a fresh recipe list after a reload rather than a patch.

Tests ​

pnpm --filter @jsprismarine/recipes test runs the unit tests: one parse and match case per serializer, shaped mirroring and offset placement, remainder items, tag ingredients, the four ingredient composition forms, and the twelve code-logic recipes with real inputs.

A corpus test runs the package over Java 26.3's own 2042 recipe files. It needs the server jar that pnpm --filter @jsprismarine/bedrock-data run fetch:sources caches, so it is gated:

sh
pnpm --filter @jsprismarine/bedrock-data run fetch:sources
JSP_VANILLA_RECIPES=1 pnpm --filter @jsprismarine/recipes test

It asserts zero parse errors over all 2042 files and that all 22 serializers appear, rebuilds an input for each recipe from its own ingredients, and reports how many matched and what compiling the set through @jsprismarine/mapping costs. Measured against Java 26.3:

MeasureCount
recipe files read2042
parse errors0
serializers seen22 of 22
inputs rebuilt2041 (only repair_item names no ingredient to build from)
rebuilt inputs the recipe accepts2041
rebuilt inputs the book returns that same recipe for first1769
compiled to Bedrock2042
reviewed losses2 (furnace_minecart and spectral_arrow, both results, both recipes kept)
identifiers with no Bedrock item0
recipes dropped0

The 272 inputs the book answers with a different recipe are almost all stonecutting, where vanilla deliberately offers several results for one input and the player picks at the station.

Interfaces ​

BannerDuplicateRecipe ​

Defined in: types.ts:214

minecraft:crafting_special_bannerduplicate: a patterned banner and a blank one of the same color.

Extends ​

  • RecipeBase

Properties ​

readonly banner: Ingredient

Defined in: types.ts:216

category? ​

readonly optional category?: string

Defined in: types.ts:98

The recipe book category, when the recipe declares one.

Inherited from ​

RecipeBase.category

group? ​

readonly optional group?: string

Defined in: types.ts:96

The recipe book group, when the recipe declares one.

Inherited from ​

RecipeBase.group

id ​

readonly id: string

Defined in: types.ts:92

The recipe's identifier, which is its datapack file path without the extension.

Inherited from ​

RecipeBase.id

result ​

readonly result: ItemStackTemplate

Defined in: types.ts:217

station ​

readonly station: "crafting" | "smelting" | "blasting" | "smoking" | "campfire_cooking" | "stonecutting" | "smithing" | "brewing"

Defined in: types.ts:94

Inherited from ​

RecipeBase.station

type ​

readonly type: "minecraft:crafting_special_bannerduplicate"

Defined in: types.ts:215

Overrides ​

RecipeBase.type


BedrockItemRef ​

Defined in: compile.ts:8

One Bedrock item reference: the identifier plus the legacy damage value where one selects a sub-item.

Extended by ​

Properties ​

data? ​

readonly optional data?: number

Defined in: compile.ts:10

identifier ​

readonly identifier: string

Defined in: compile.ts:9


BookCloningRecipe ​

Defined in: types.ts:221

minecraft:crafting_special_bookcloning: one written book plus blank books, one copy each.

Extends ​

  • RecipeBase

Properties ​

allowedGenerations ​

readonly allowedGenerations: IntRange

Defined in: types.ts:226

Which generation values of the source book may be copied. Defaults to 0 to 1; Java caps the field at 0 to 2.

category? ​

readonly optional category?: string

Defined in: types.ts:98

The recipe book category, when the recipe declares one.

Inherited from ​

RecipeBase.category

group? ​

readonly optional group?: string

Defined in: types.ts:96

The recipe book group, when the recipe declares one.

Inherited from ​

RecipeBase.group

id ​

readonly id: string

Defined in: types.ts:92

The recipe's identifier, which is its datapack file path without the extension.

Inherited from ​

RecipeBase.id

material ​

readonly material: Ingredient

Defined in: types.ts:224

result ​

readonly result: ItemStackTemplate

Defined in: types.ts:227

source ​

readonly source: Ingredient

Defined in: types.ts:223

station ​

readonly station: "crafting" | "smelting" | "blasting" | "smoking" | "campfire_cooking" | "stonecutting" | "smithing" | "brewing"

Defined in: types.ts:94

Inherited from ​

RecipeBase.station

type ​

readonly type: "minecraft:crafting_special_bookcloning"

Defined in: types.ts:222

Overrides ​

RecipeBase.type


BrewingRecipe ​

Defined in: types.ts:206

minecraft:brewing: one reagent above three identical inputs in a brewing stand.

Extends ​

  • RecipeBase

Properties ​

category? ​

readonly optional category?: string

Defined in: types.ts:98

The recipe book category, when the recipe declares one.

Inherited from ​

RecipeBase.category

group? ​

readonly optional group?: string

Defined in: types.ts:96

The recipe book group, when the recipe declares one.

Inherited from ​

RecipeBase.group

id ​

readonly id: string

Defined in: types.ts:92

The recipe's identifier, which is its datapack file path without the extension.

Inherited from ​

RecipeBase.id

input ​

readonly input: Ingredient

Defined in: types.ts:208

output ​

readonly output: ItemStackTemplate

Defined in: types.ts:210

reagent ​

readonly reagent: Ingredient

Defined in: types.ts:209

station ​

readonly station: "crafting" | "smelting" | "blasting" | "smoking" | "campfire_cooking" | "stonecutting" | "smithing" | "brewing"

Defined in: types.ts:94

Inherited from ​

RecipeBase.station

type ​

readonly type: "minecraft:brewing"

Defined in: types.ts:207

Overrides ​

RecipeBase.type


CompiledIngredient ​

Defined in: compile.ts:50

One compiled ingredient: every Bedrock item it accepts, plus the Java tags it was written as.

Properties ​

items ​

readonly items: readonly BedrockItemRef[]

Defined in: compile.ts:51

tags ​

readonly tags: readonly string[]

Defined in: compile.ts:53

The Java item tags the ingredient came from, kept so a caller can emit a Bedrock tag descriptor instead.


CompiledRecipe ​

Defined in: compile.ts:62

One recipe translated to Bedrock identifiers, ready for a CraftingDataPacket entry.

Properties ​

blockTags ​

readonly blockTags: readonly string[]

Defined in: compile.ts:69

The Bedrock block tags the client needs to show the recipe at a station.

id ​

readonly id: string

Defined in: compile.ts:63

ingredients ​

readonly ingredients: readonly (CompiledIngredient | null)[]

Defined in: compile.ts:77

Ingredients in the same order recipeIngredients reports them: row-major pattern cells for a shaped recipe, declaration order otherwise. null is an empty shaped cell or an omitted optional slot.

netId ​

readonly netId: number

Defined in: compile.ts:67

The network id, from registry order.

result? ​

readonly optional result?: CompiledResult

Defined in: compile.ts:84

The result, or undefined for the recipes that build theirs from an input stack: repair_item, smithing_trim, map_cloning and map_extending. A Bedrock client cannot be shown those as a plain result and the server has to answer for them.

shape? ​

readonly optional shape?: object

Defined in: compile.ts:71

The pattern size, for minecraft:crafting_shaped only.

height ​

readonly height: number

width ​

readonly width: number

station ​

readonly station: "crafting" | "smelting" | "blasting" | "smoking" | "campfire_cooking" | "stonecutting" | "smithing" | "brewing"

Defined in: compile.ts:65

type ​

readonly type: "minecraft:blasting" | "minecraft:brewing" | "minecraft:campfire_cooking" | "minecraft:crafting_decorated_pot" | "minecraft:crafting_dye" | "minecraft:crafting_imbue" | "minecraft:crafting_shaped" | "minecraft:crafting_shapeless" | "minecraft:crafting_special_bannerduplicate" | "minecraft:crafting_special_bookcloning" | "minecraft:crafting_special_firework_rocket" | "minecraft:crafting_special_firework_star" | "minecraft:crafting_special_firework_star_fade" | "minecraft:crafting_special_mapextending" | "minecraft:crafting_special_repairitem" | "minecraft:crafting_special_shielddecoration" | "minecraft:crafting_transmute" | "minecraft:smelting" | "minecraft:smithing_transform" | "minecraft:smithing_trim" | "minecraft:smoking" | "minecraft:stonecutting"

Defined in: compile.ts:64


CompiledResult ​

Defined in: compile.ts:57

One compiled result stack.

Extends ​

Properties ​

count ​

readonly count: number

Defined in: compile.ts:58

data? ​

readonly optional data?: number

Defined in: compile.ts:10

Inherited from ​

BedrockItemRef.data

identifier ​

readonly identifier: string

Defined in: compile.ts:9

Inherited from ​

BedrockItemRef.identifier


ComponentPredicate ​

Defined in: ingredient.ts:19

A predicate on one Java data component of a candidate stack. Java's ingredient grammar carries these in the inline object form, which vanilla 26.3 uses only for the 279 brewing recipes.

Properties ​

component ​

readonly component: string

Defined in: ingredient.ts:21

The namespaced component identifier the predicate reads.

potions? ​

readonly optional potions?: readonly string[]

Defined in: ingredient.ts:28

For minecraft:potion_contents, the potions field resolved through the potion registry. Absent for every other component.

value ​

readonly value: unknown

Defined in: ingredient.ts:23

The predicate body exactly as the recipe wrote it.


CookingRecipe ​

Defined in: types.ts:168

The four cooking serializers, which differ only in their station and their vanilla cooking times.

Extends ​

  • RecipeBase

Properties ​

category? ​

readonly optional category?: string

Defined in: types.ts:98

The recipe book category, when the recipe declares one.

Inherited from ​

RecipeBase.category

cookingTime ​

readonly cookingTime: number

Defined in: types.ts:175

How many ticks the cook takes.

experience ​

readonly experience: number

Defined in: types.ts:173

Experience the station drops when the result is collected.

group? ​

readonly optional group?: string

Defined in: types.ts:96

The recipe book group, when the recipe declares one.

Inherited from ​

RecipeBase.group

id ​

readonly id: string

Defined in: types.ts:92

The recipe's identifier, which is its datapack file path without the extension.

Inherited from ​

RecipeBase.id

ingredient ​

readonly ingredient: Ingredient

Defined in: types.ts:170

result ​

readonly result: ItemStackTemplate

Defined in: types.ts:171

station ​

readonly station: "crafting" | "smelting" | "blasting" | "smoking" | "campfire_cooking" | "stonecutting" | "smithing" | "brewing"

Defined in: types.ts:94

Inherited from ​

RecipeBase.station

type ​

readonly type: "minecraft:blasting" | "minecraft:campfire_cooking" | "minecraft:smelting" | "minecraft:smoking"

Defined in: types.ts:169

Overrides ​

RecipeBase.type


CraftingGrid ​

Defined in: grid.ts:4

The contents of a crafting grid of a declared size, in row-major order.

Extended by ​

Properties ​

height ​

readonly height: number

Defined in: grid.ts:6

slots ​

readonly slots: readonly (RecipeItemStack | null)[]

Defined in: grid.ts:8

width * height slots in row-major order, null where the slot is empty.

width ​

readonly width: number

Defined in: grid.ts:5


CroppedGrid ​

Defined in: grid.ts:16

A crafting grid shrunk to the bounding box of its filled slots, which is what Java's CraftingInput.ofPositioned builds before any recipe sees the grid. Cropping is what lets a 2x2 recipe match anywhere in a 3x3 table.

Extends ​

Properties ​

filled ​

readonly filled: number

Defined in: grid.ts:20

How many cropped slots hold an item.

height ​

readonly height: number

Defined in: grid.ts:6

Inherited from ​

CraftingGrid.height

slots ​

readonly slots: readonly (RecipeItemStack | null)[]

Defined in: grid.ts:8

width * height slots in row-major order, null where the slot is empty.

Inherited from ​

CraftingGrid.slots

sourceSlots ​

readonly sourceSlots: readonly number[]

Defined in: grid.ts:18

For each cropped slot, the index it came from in the original grid.

width ​

readonly width: number

Defined in: grid.ts:5

Inherited from ​

CraftingGrid.width


DecoratedPotRecipe ​

Defined in: types.ts:158

minecraft:crafting_decorated_pot: four sherds or bricks at the four edge-center slots of a 3x3 grid.

Extends ​

  • RecipeBase

Properties ​

back ​

readonly back: Ingredient

Defined in: types.ts:160

category? ​

readonly optional category?: string

Defined in: types.ts:98

The recipe book category, when the recipe declares one.

Inherited from ​

RecipeBase.category

front ​

readonly front: Ingredient

Defined in: types.ts:163

group? ​

readonly optional group?: string

Defined in: types.ts:96

The recipe book group, when the recipe declares one.

Inherited from ​

RecipeBase.group

id ​

readonly id: string

Defined in: types.ts:92

The recipe's identifier, which is its datapack file path without the extension.

Inherited from ​

RecipeBase.id

left ​

readonly left: Ingredient

Defined in: types.ts:161

result ​

readonly result: ItemStackTemplate

Defined in: types.ts:164

readonly right: Ingredient

Defined in: types.ts:162

station ​

readonly station: "crafting" | "smelting" | "blasting" | "smoking" | "campfire_cooking" | "stonecutting" | "smithing" | "brewing"

Defined in: types.ts:94

Inherited from ​

RecipeBase.station

type ​

readonly type: "minecraft:crafting_decorated_pot"

Defined in: types.ts:159

Overrides ​

RecipeBase.type


DyeRecipe ​

Defined in: types.ts:142

minecraft:crafting_dye: one dyeable target plus one to eight dyes.

Extends ​

  • RecipeBase

Properties ​

category? ​

readonly optional category?: string

Defined in: types.ts:98

The recipe book category, when the recipe declares one.

Inherited from ​

RecipeBase.category

dye ​

readonly dye: Ingredient

Defined in: types.ts:145

group? ​

readonly optional group?: string

Defined in: types.ts:96

The recipe book group, when the recipe declares one.

Inherited from ​

RecipeBase.group

id ​

readonly id: string

Defined in: types.ts:92

The recipe's identifier, which is its datapack file path without the extension.

Inherited from ​

RecipeBase.id

result ​

readonly result: ItemStackTemplate

Defined in: types.ts:146

station ​

readonly station: "crafting" | "smelting" | "blasting" | "smoking" | "campfire_cooking" | "stonecutting" | "smithing" | "brewing"

Defined in: types.ts:94

Inherited from ​

RecipeBase.station

target ​

readonly target: Ingredient

Defined in: types.ts:144

type ​

readonly type: "minecraft:crafting_dye"

Defined in: types.ts:143

Overrides ​

RecipeBase.type


FireworkRocketRecipe ​

Defined in: types.ts:231

minecraft:crafting_special_firework_rocket: one shell, one to three fuel, and up to seven stars.

Extends ​

  • RecipeBase

Properties ​

category? ​

readonly optional category?: string

Defined in: types.ts:98

The recipe book category, when the recipe declares one.

Inherited from ​

RecipeBase.category

fuel ​

readonly fuel: Ingredient

Defined in: types.ts:234

group? ​

readonly optional group?: string

Defined in: types.ts:96

The recipe book group, when the recipe declares one.

Inherited from ​

RecipeBase.group

id ​

readonly id: string

Defined in: types.ts:92

The recipe's identifier, which is its datapack file path without the extension.

Inherited from ​

RecipeBase.id

result ​

readonly result: ItemStackTemplate

Defined in: types.ts:236

shell ​

readonly shell: Ingredient

Defined in: types.ts:233

star ​

readonly star: Ingredient

Defined in: types.ts:235

station ​

readonly station: "crafting" | "smelting" | "blasting" | "smoking" | "campfire_cooking" | "stonecutting" | "smithing" | "brewing"

Defined in: types.ts:94

Inherited from ​

RecipeBase.station

type ​

readonly type: "minecraft:crafting_special_firework_rocket"

Defined in: types.ts:232

Overrides ​

RecipeBase.type


FireworkStarFadeRecipe ​

Defined in: types.ts:252

minecraft:crafting_special_firework_star_fade: one firework star plus one to eight dyes.

Extends ​

  • RecipeBase

Properties ​

category? ​

readonly optional category?: string

Defined in: types.ts:98

The recipe book category, when the recipe declares one.

Inherited from ​

RecipeBase.category

dye ​

readonly dye: Ingredient

Defined in: types.ts:255

group? ​

readonly optional group?: string

Defined in: types.ts:96

The recipe book group, when the recipe declares one.

Inherited from ​

RecipeBase.group

id ​

readonly id: string

Defined in: types.ts:92

The recipe's identifier, which is its datapack file path without the extension.

Inherited from ​

RecipeBase.id

result ​

readonly result: ItemStackTemplate

Defined in: types.ts:256

station ​

readonly station: "crafting" | "smelting" | "blasting" | "smoking" | "campfire_cooking" | "stonecutting" | "smithing" | "brewing"

Defined in: types.ts:94

Inherited from ​

RecipeBase.station

target ​

readonly target: Ingredient

Defined in: types.ts:254

type ​

readonly type: "minecraft:crafting_special_firework_star_fade"

Defined in: types.ts:253

Overrides ​

RecipeBase.type


FireworkStarRecipe ​

Defined in: types.ts:240

minecraft:crafting_special_firework_star: one fuel, one to eight dyes, and optional shape and effect modifiers.

Extends ​

  • RecipeBase

Properties ​

category? ​

readonly optional category?: string

Defined in: types.ts:98

The recipe book category, when the recipe declares one.

Inherited from ​

RecipeBase.category

dye ​

readonly dye: Ingredient

Defined in: types.ts:243

fuel ​

readonly fuel: Ingredient

Defined in: types.ts:242

group? ​

readonly optional group?: string

Defined in: types.ts:96

The recipe book group, when the recipe declares one.

Inherited from ​

RecipeBase.group

id ​

readonly id: string

Defined in: types.ts:92

The recipe's identifier, which is its datapack file path without the extension.

Inherited from ​

RecipeBase.id

result ​

readonly result: ItemStackTemplate

Defined in: types.ts:248

shapes ​

readonly shapes: Readonly<Record<string, Ingredient>>

Defined in: types.ts:245

The item that selects each explosion shape, keyed by the shape name the result records.

station ​

readonly station: "crafting" | "smelting" | "blasting" | "smoking" | "campfire_cooking" | "stonecutting" | "smithing" | "brewing"

Defined in: types.ts:94

Inherited from ​

RecipeBase.station

trail ​

readonly trail: Ingredient

Defined in: types.ts:246

twinkle ​

readonly twinkle: Ingredient

Defined in: types.ts:247

type ​

readonly type: "minecraft:crafting_special_firework_star"

Defined in: types.ts:241

Overrides ​

RecipeBase.type


ImbueRecipe ​

Defined in: types.ts:150

minecraft:crafting_imbue: eight materials around one source, which is how tipped arrows are made.

Extends ​

  • RecipeBase

Properties ​

category? ​

readonly optional category?: string

Defined in: types.ts:98

The recipe book category, when the recipe declares one.

Inherited from ​

RecipeBase.category

group? ​

readonly optional group?: string

Defined in: types.ts:96

The recipe book group, when the recipe declares one.

Inherited from ​

RecipeBase.group

id ​

readonly id: string

Defined in: types.ts:92

The recipe's identifier, which is its datapack file path without the extension.

Inherited from ​

RecipeBase.id

material ​

readonly material: Ingredient

Defined in: types.ts:153

result ​

readonly result: ItemStackTemplate

Defined in: types.ts:154

source ​

readonly source: Ingredient

Defined in: types.ts:152

station ​

readonly station: "crafting" | "smelting" | "blasting" | "smoking" | "campfire_cooking" | "stonecutting" | "smithing" | "brewing"

Defined in: types.ts:94

Inherited from ​

RecipeBase.station

type ​

readonly type: "minecraft:crafting_imbue"

Defined in: types.ts:151

Overrides ​

RecipeBase.type


Ingredient ​

Defined in: ingredient.ts:35

One resolved recipe ingredient: the item identifiers it accepts plus any component predicate a candidate stack has to satisfy.

Properties ​

components ​

readonly components: readonly ComponentPredicate[]

Defined in: ingredient.ts:41

Component predicates every candidate stack has to satisfy.

items ​

readonly items: readonly string[]

Defined in: ingredient.ts:37

Every accepted Java item identifier, in declaration order with duplicates removed.

tags ​

readonly tags: readonly string[]

Defined in: ingredient.ts:39

The item tags the ingredient was written as, in declaration order, without the leading #.


IngredientDiagnostic ​

Defined in: ingredient.ts:45

Why an ingredient failed to parse, or what it lost while parsing.

Properties ​

message ​

readonly message: string

Defined in: ingredient.ts:49

path ​

readonly path: string

Defined in: ingredient.ts:48

Dotted path to the offending field inside the recipe JSON, such as key.#.

severity ​

readonly severity: "error" | "warning"

Defined in: ingredient.ts:46


IngredientParseResult ​

Defined in: ingredient.ts:53

What parseIngredient produced.

Properties ​

diagnostics ​

readonly diagnostics: readonly IngredientDiagnostic[]

Defined in: ingredient.ts:56

ingredient? ​

readonly optional ingredient?: Ingredient

Defined in: ingredient.ts:55

The ingredient, absent when the form was not one the grammar accepts.


IntRange ​

Defined in: itemStack.ts:30

An inclusive integer range, Java's MinMaxBounds.Ints with both bounds present.

Properties ​

max ​

readonly max: number

Defined in: itemStack.ts:32

min ​

readonly min: number

Defined in: itemStack.ts:31


ItemStackTemplate ​

Defined in: itemStack.ts:20

An item stack as a recipe declares it. id is absent on the two vanilla recipes whose result is derived from an input stack rather than named, map_cloning and map_extending.

Properties ​

components? ​

readonly optional components?: Readonly<Record<string, unknown>>

Defined in: itemStack.ts:26

Java data components the recipe sets on the result.

count ​

readonly count: number

Defined in: itemStack.ts:24

How many items the result holds. Defaults to 1 when the recipe omits count.

id? ​

readonly optional id?: string

Defined in: itemStack.ts:22

The namespaced Java item identifier, absent when the result comes from an input stack.


MapExtendingRecipe ​

Defined in: types.ts:260

minecraft:crafting_special_mapextending: a filled map centered in a 3x3 grid of paper.

Extends ​

  • RecipeBase

Properties ​

category? ​

readonly optional category?: string

Defined in: types.ts:98

The recipe book category, when the recipe declares one.

Inherited from ​

RecipeBase.category

group? ​

readonly optional group?: string

Defined in: types.ts:96

The recipe book group, when the recipe declares one.

Inherited from ​

RecipeBase.group

id ​

readonly id: string

Defined in: types.ts:92

The recipe's identifier, which is its datapack file path without the extension.

Inherited from ​

RecipeBase.id

map ​

readonly map: Ingredient

Defined in: types.ts:262

material ​

readonly material: Ingredient

Defined in: types.ts:263

result ​

readonly result: ItemStackTemplate

Defined in: types.ts:264

station ​

readonly station: "crafting" | "smelting" | "blasting" | "smoking" | "campfire_cooking" | "stonecutting" | "smithing" | "brewing"

Defined in: types.ts:94

Inherited from ​

RecipeBase.station

type ​

readonly type: "minecraft:crafting_special_mapextending"

Defined in: types.ts:261

Overrides ​

RecipeBase.type


RecipeBook ​

Defined in: book.ts:17

Every loaded recipe, ordered, numbered, and indexed by station. This is the object the server holds: it answers "what does this grid make" and "what network id does this recipe have" without the caller knowing how either is worked out.

Properties ​

netIds ​

readonly netIds: ReadonlyMap<string, number>

Defined in: book.ts:21

The network id of every recipe, keyed by identifier.

recipes ​

readonly recipes: readonly Recipe[]

Defined in: book.ts:19

Every recipe in registry order, which is also network id order.

Methods ​

byStation() ​

byStation(station): readonly Recipe[]

Defined in: book.ts:25

Every recipe matched at one station, in registry order.

Parameters ​
station ​

"crafting" | "smelting" | "blasting" | "smoking" | "campfire_cooking" | "stonecutting" | "smithing" | "brewing"

Returns ​

readonly Recipe[]

get() ​

get(id): Recipe | undefined

Defined in: book.ts:23

One recipe by identifier.

Parameters ​
id ​

string

Returns ​

Recipe | undefined

match() ​

match(input): RecipeMatch | undefined

Defined in: book.ts:27

The first recipe that accepts the input, in registry order.

Parameters ​
input ​

RecipeInput

Returns ​

RecipeMatch | undefined

matchAll() ​

matchAll(input): readonly RecipeMatch[]

Defined in: book.ts:29

Every recipe that accepts the input, in registry order.

Parameters ​
input ​

RecipeInput

Returns ​

readonly RecipeMatch[]


RecipeCompileGap ​

Defined in: compile.ts:97

One identifier a recipe uses that has no Bedrock item at all.

Properties ​

dropped ​

readonly dropped: boolean

Defined in: compile.ts:102

Whether the gap cost the whole recipe, which happens when the result or a whole ingredient is unmappable.

javaId ​

readonly javaId: string

Defined in: compile.ts:99

recipeId ​

readonly recipeId: string

Defined in: compile.ts:98

where ​

readonly where: "ingredient" | "result"

Defined in: compile.ts:100


RecipeCompileLoss ​

Defined in: compile.ts:88

One place the Java-to-Bedrock mapping lost information while compiling a recipe.

Properties ​

javaId ​

readonly javaId: string

Defined in: compile.ts:90

reason ​

readonly reason: string

Defined in: compile.ts:93

recipeId ​

readonly recipeId: string

Defined in: compile.ts:89

where ​

readonly where: "ingredient" | "result"

Defined in: compile.ts:92

Whether the identifier was on the input or the output side.


RecipeCompileReport ​

Defined in: compile.ts:106

Everything compileRecipes produced, including the recipes it could not translate cleanly.

Properties ​

dropped ​

readonly dropped: readonly object[]

Defined in: compile.ts:114

Recipes left out entirely, with the identifier that cost them.

gaps ​

readonly gaps: readonly RecipeCompileGap[]

Defined in: compile.ts:112

Every identifier with no Bedrock item, and whether the recipe survived without it.

losses ​

readonly losses: readonly RecipeCompileLoss[]

Defined in: compile.ts:110

Every reviewed loss. The recipes are still in recipes; the losses are listed so a dashboard can count them.

recipes ​

readonly recipes: readonly CompiledRecipe[]

Defined in: compile.ts:108

Every recipe that compiled, in network id order.


RecipeContext ​

Defined in: context.ts:9

The lookups this package needs from the rest of the server. Every one is injected so the evaluator depends on no registry implementation, and every one is optional so a caller can start with none and add them as the registries come up. Each entry below says what stops working without it.

Properties ​

dyeColorRgb? ​

readonly optional dyeColorRgb?: (dyeColor) => number | undefined

Defined in: context.ts:32

The packed 24-bit RGB value of a dye color name such as red, from Java's DyeColor table. Without it dyed armor keeps its old color and a firework star records no colors.

Parameters ​
dyeColor ​

string

Returns ​

number | undefined

maxDamageOf? ​

readonly optional maxDamageOf?: (itemId) => number | undefined

Defined in: context.ts:26

An item's minecraft:max_damage, or undefined for an item that takes no damage. Without it the repair recipe never matches, because damageability is what it tests for.

Parameters ​
itemId ​

string

Returns ​

number | undefined

remainderOf? ​

readonly optional remainderOf?: (itemId) => string | undefined

Defined in: context.ts:20

The item an ingredient leaves behind when a craft consumes it, from Java's minecraft:crafting_remainder item component. Without it a bucket or a honey bottle vanishes into the craft.

Parameters ​
itemId ​

string

Returns ​

string | undefined

tags? ​

readonly optional tags?: TagLookup

Defined in: context.ts:14

Resolves a Java tag to its members. Needed at parse time: without it every #tag ingredient accepts nothing and parsing reports a warning.


RecipeDiagnostic ​

Defined in: parse.ts:10

One problem found while reading a recipe file.

Properties ​

message ​

readonly message: string

Defined in: parse.ts:16

path ​

readonly path: string

Defined in: parse.ts:15

Dotted path to the offending field inside the recipe JSON.

recipeId ​

readonly recipeId: string

Defined in: parse.ts:13

The recipe's identifier.

severity ​

readonly severity: "error" | "warning"

Defined in: parse.ts:11


RecipeItemStack ​

Defined in: itemStack.ts:6

One item stack as the recipe evaluator sees it: a Java identifier, a count, and the Java data components that the recipe grammar reads or writes. Components the evaluator never touches travel through untouched.

Properties ​

components? ​

readonly optional components?: Readonly<Record<string, unknown>>

Defined in: itemStack.ts:12

Java data components keyed by their namespaced identifier.

count ​

readonly count: number

Defined in: itemStack.ts:10

How many items the stack holds. A stack in a crafting slot always holds at least one.

id ​

readonly id: string

Defined in: itemStack.ts:8

The namespaced Java item identifier.


RecipeLoadResult ​

Defined in: book.ts:162

A recipe book plus everything that went wrong while reading the files behind it.

Properties ​

book ​

readonly book: RecipeBook

Defined in: book.ts:163

diagnostics ​

readonly diagnostics: readonly RecipeDiagnostic[]

Defined in: book.ts:164

failed ​

readonly failed: readonly string[]

Defined in: book.ts:166

Identifiers whose file failed to parse, so the book does not hold them.


RecipeMatch ​

Defined in: match.ts:50

A recipe that accepts an input, with everything the caller needs to apply the craft.

Properties ​

consumed ​

readonly consumed: readonly number[]

Defined in: match.ts:58

How many items the craft takes from each input slot, in the input's own slot order: the full crafting grid in row-major order, or the station's slots in the order RecipeInput declares them.

cookingTime? ​

readonly optional cookingTime?: number

Defined in: match.ts:69

How many ticks the cook takes, for the four cooking serializers.

experience? ​

readonly optional experience?: number

Defined in: match.ts:67

Experience the station drops, for the four cooking serializers.

recipe ​

readonly recipe: Recipe

Defined in: match.ts:51

remainder ​

readonly remainder: readonly (RecipeItemStack | null)[]

Defined in: match.ts:65

What the craft puts back into each slot after the consumption above, aligned with consumed. This is the bucket a milk bucket leaves, the glass bottle honey leaves, or the source item a duplicating recipe returns. null where the craft leaves nothing.

result ​

readonly result: RecipeItemStack

Defined in: match.ts:52


RecipeParseResult ​

Defined in: parse.ts:23

What parseRecipe produced. recipe is absent exactly when the diagnostics hold an error; warnings leave a usable recipe behind.

Properties ​

diagnostics ​

readonly diagnostics: readonly RecipeDiagnostic[]

Defined in: parse.ts:25

recipe? ​

readonly optional recipe?: Recipe

Defined in: parse.ts:24


RepairItemRecipe ​

Defined in: types.ts:268

minecraft:crafting_special_repairitem: two damaged copies of one item combine into a repaired one.

Extends ​

  • RecipeBase

Properties ​

category? ​

readonly optional category?: string

Defined in: types.ts:98

The recipe book category, when the recipe declares one.

Inherited from ​

RecipeBase.category

group? ​

readonly optional group?: string

Defined in: types.ts:96

The recipe book group, when the recipe declares one.

Inherited from ​

RecipeBase.group

id ​

readonly id: string

Defined in: types.ts:92

The recipe's identifier, which is its datapack file path without the extension.

Inherited from ​

RecipeBase.id

station ​

readonly station: "crafting" | "smelting" | "blasting" | "smoking" | "campfire_cooking" | "stonecutting" | "smithing" | "brewing"

Defined in: types.ts:94

Inherited from ​

RecipeBase.station

type ​

readonly type: "minecraft:crafting_special_repairitem"

Defined in: types.ts:269

Overrides ​

RecipeBase.type


ShapedPattern ​

Defined in: types.ts:102

A shaped pattern laid out row by row, with null for an empty cell.

Properties ​

cells ​

readonly cells: readonly (Ingredient | null)[]

Defined in: types.ts:106

width * height cells in row-major order.

height ​

readonly height: number

Defined in: types.ts:104

width ​

readonly width: number

Defined in: types.ts:103


ShapedRecipe ​

Defined in: types.ts:110

minecraft:crafting_shaped: a pattern plus its key, matched with mirroring and offset placement.

Extends ​

  • RecipeBase

Properties ​

category? ​

readonly optional category?: string

Defined in: types.ts:98

The recipe book category, when the recipe declares one.

Inherited from ​

RecipeBase.category

group? ​

readonly optional group?: string

Defined in: types.ts:96

The recipe book group, when the recipe declares one.

Inherited from ​

RecipeBase.group

id ​

readonly id: string

Defined in: types.ts:92

The recipe's identifier, which is its datapack file path without the extension.

Inherited from ​

RecipeBase.id

pattern ​

readonly pattern: ShapedPattern

Defined in: types.ts:112

result ​

readonly result: ItemStackTemplate

Defined in: types.ts:113

showNotification ​

readonly showNotification: boolean

Defined in: types.ts:115

Whether the client pops a recipe book notification on unlock. One vanilla recipe sets this false.

station ​

readonly station: "crafting" | "smelting" | "blasting" | "smoking" | "campfire_cooking" | "stonecutting" | "smithing" | "brewing"

Defined in: types.ts:94

Inherited from ​

RecipeBase.station

type ​

readonly type: "minecraft:crafting_shaped"

Defined in: types.ts:111

Overrides ​

RecipeBase.type


ShapelessRecipe ​

Defined in: types.ts:119

minecraft:crafting_shapeless: up to nine ingredients in any arrangement.

Extends ​

  • RecipeBase

Properties ​

category? ​

readonly optional category?: string

Defined in: types.ts:98

The recipe book category, when the recipe declares one.

Inherited from ​

RecipeBase.category

group? ​

readonly optional group?: string

Defined in: types.ts:96

The recipe book group, when the recipe declares one.

Inherited from ​

RecipeBase.group

id ​

readonly id: string

Defined in: types.ts:92

The recipe's identifier, which is its datapack file path without the extension.

Inherited from ​

RecipeBase.id

ingredients ​

readonly ingredients: readonly Ingredient[]

Defined in: types.ts:121

result ​

readonly result: ItemStackTemplate

Defined in: types.ts:122

station ​

readonly station: "crafting" | "smelting" | "blasting" | "smoking" | "campfire_cooking" | "stonecutting" | "smithing" | "brewing"

Defined in: types.ts:94

Inherited from ​

RecipeBase.station

type ​

readonly type: "minecraft:crafting_shapeless"

Defined in: types.ts:120

Overrides ​

RecipeBase.type


ShieldDecorationRecipe ​

Defined in: types.ts:273

minecraft:crafting_special_shielddecoration: a shield takes the banner's base color and patterns.

Extends ​

  • RecipeBase

Properties ​

readonly banner: Ingredient

Defined in: types.ts:275

category? ​

readonly optional category?: string

Defined in: types.ts:98

The recipe book category, when the recipe declares one.

Inherited from ​

RecipeBase.category

group? ​

readonly optional group?: string

Defined in: types.ts:96

The recipe book group, when the recipe declares one.

Inherited from ​

RecipeBase.group

id ​

readonly id: string

Defined in: types.ts:92

The recipe's identifier, which is its datapack file path without the extension.

Inherited from ​

RecipeBase.id

result ​

readonly result: ItemStackTemplate

Defined in: types.ts:277

station ​

readonly station: "crafting" | "smelting" | "blasting" | "smoking" | "campfire_cooking" | "stonecutting" | "smithing" | "brewing"

Defined in: types.ts:94

Inherited from ​

RecipeBase.station

target ​

readonly target: Ingredient

Defined in: types.ts:276

type ​

readonly type: "minecraft:crafting_special_shielddecoration"

Defined in: types.ts:274

Overrides ​

RecipeBase.type


SmithingTransformRecipe ​

Defined in: types.ts:186

minecraft:smithing_transform: template plus base plus addition yields a named result.

Extends ​

  • RecipeBase

Properties ​

addition? ​

readonly optional addition?: Ingredient

Defined in: types.ts:191

base ​

readonly base: Ingredient

Defined in: types.ts:190

category? ​

readonly optional category?: string

Defined in: types.ts:98

The recipe book category, when the recipe declares one.

Inherited from ​

RecipeBase.category

group? ​

readonly optional group?: string

Defined in: types.ts:96

The recipe book group, when the recipe declares one.

Inherited from ​

RecipeBase.group

id ​

readonly id: string

Defined in: types.ts:92

The recipe's identifier, which is its datapack file path without the extension.

Inherited from ​

RecipeBase.id

result ​

readonly result: ItemStackTemplate

Defined in: types.ts:192

station ​

readonly station: "crafting" | "smelting" | "blasting" | "smoking" | "campfire_cooking" | "stonecutting" | "smithing" | "brewing"

Defined in: types.ts:94

Inherited from ​

RecipeBase.station

template? ​

readonly optional template?: Ingredient

Defined in: types.ts:189

Absent when the recipe accepts any template slot content, including an empty one.

type ​

readonly type: "minecraft:smithing_transform"

Defined in: types.ts:187

Overrides ​

RecipeBase.type


SmithingTrimRecipe ​

Defined in: types.ts:196

minecraft:smithing_trim: the base keeps its identity and gains an armor trim.

Extends ​

  • RecipeBase

Properties ​

addition? ​

readonly optional addition?: Ingredient

Defined in: types.ts:200

base ​

readonly base: Ingredient

Defined in: types.ts:199

category? ​

readonly optional category?: string

Defined in: types.ts:98

The recipe book category, when the recipe declares one.

Inherited from ​

RecipeBase.category

group? ​

readonly optional group?: string

Defined in: types.ts:96

The recipe book group, when the recipe declares one.

Inherited from ​

RecipeBase.group

id ​

readonly id: string

Defined in: types.ts:92

The recipe's identifier, which is its datapack file path without the extension.

Inherited from ​

RecipeBase.id

pattern ​

readonly pattern: string

Defined in: types.ts:202

The minecraft:trim_pattern identifier the craft writes onto the base.

station ​

readonly station: "crafting" | "smelting" | "blasting" | "smoking" | "campfire_cooking" | "stonecutting" | "smithing" | "brewing"

Defined in: types.ts:94

Inherited from ​

RecipeBase.station

template? ​

readonly optional template?: Ingredient

Defined in: types.ts:198

type ​

readonly type: "minecraft:smithing_trim"

Defined in: types.ts:197

Overrides ​

RecipeBase.type


StonecuttingRecipe ​

Defined in: types.ts:179

minecraft:stonecutting: one input, one result, selected by the player at the stonecutter.

Extends ​

  • RecipeBase

Properties ​

category? ​

readonly optional category?: string

Defined in: types.ts:98

The recipe book category, when the recipe declares one.

Inherited from ​

RecipeBase.category

group? ​

readonly optional group?: string

Defined in: types.ts:96

The recipe book group, when the recipe declares one.

Inherited from ​

RecipeBase.group

id ​

readonly id: string

Defined in: types.ts:92

The recipe's identifier, which is its datapack file path without the extension.

Inherited from ​

RecipeBase.id

ingredient ​

readonly ingredient: Ingredient

Defined in: types.ts:181

result ​

readonly result: ItemStackTemplate

Defined in: types.ts:182

station ​

readonly station: "crafting" | "smelting" | "blasting" | "smoking" | "campfire_cooking" | "stonecutting" | "smithing" | "brewing"

Defined in: types.ts:94

Inherited from ​

RecipeBase.station

type ​

readonly type: "minecraft:stonecutting"

Defined in: types.ts:180

Overrides ​

RecipeBase.type


TransmuteRecipe ​

Defined in: types.ts:130

minecraft:crafting_transmute: one input keeps its components while its identifier changes, consuming a counted material. Vanilla uses it for shulker box and bundle dyeing and for map cloning.

Extends ​

  • RecipeBase

Properties ​

addMaterialCountToResult ​

readonly addMaterialCountToResult: boolean

Defined in: types.ts:137

Whether the result count is the material count plus one, which is how map cloning scales.

category? ​

readonly optional category?: string

Defined in: types.ts:98

The recipe book category, when the recipe declares one.

Inherited from ​

RecipeBase.category

group? ​

readonly optional group?: string

Defined in: types.ts:96

The recipe book group, when the recipe declares one.

Inherited from ​

RecipeBase.group

id ​

readonly id: string

Defined in: types.ts:92

The recipe's identifier, which is its datapack file path without the extension.

Inherited from ​

RecipeBase.id

input ​

readonly input: Ingredient

Defined in: types.ts:132

material ​

readonly material: Ingredient

Defined in: types.ts:133

materialCount ​

readonly materialCount: IntRange

Defined in: types.ts:135

How many material items the craft takes. Defaults to exactly 1; Java caps the field at 1 to 8.

result ​

readonly result: ItemStackTemplate

Defined in: types.ts:138

station ​

readonly station: "crafting" | "smelting" | "blasting" | "smoking" | "campfire_cooking" | "stonecutting" | "smithing" | "brewing"

Defined in: types.ts:94

Inherited from ​

RecipeBase.station

type ​

readonly type: "minecraft:crafting_transmute"

Defined in: types.ts:131

Overrides ​

RecipeBase.type

Type Aliases ​

JavaItemMapper ​

JavaItemMapper = (javaId) => JavaItemMapping

Defined in: compile.ts:29

The item half of the Java-to-Bedrock seam, injected so this package depends on no mapping table.

Parameters ​

javaId ​

string

Returns ​

JavaItemMapping


JavaItemMapping ​

JavaItemMapping = { bedrock: BedrockItemRef; kind: "mapped"; } | { bedrock: BedrockItemRef; kind: "loss"; loss: { reason: string; }; } | { bedrock: BedrockItemRef; kind: "passthrough"; } | { javaId: string; kind: "unknown"; }

Defined in: compile.ts:18

What a Java item lookup produced. @jsprismarine/mapping's javaItemToBedrock returns exactly this shape, which is how the two packages meet without this one depending on that one at runtime.

Union Members ​

Type Literal ​

{ bedrock: BedrockItemRef; kind: "mapped"; }

The Bedrock item registry knows the item.


Type Literal ​

{ bedrock: BedrockItemRef; kind: "loss"; loss: { reason: string; }; }

A reviewed loss: the Java identity does not survive, and bedrock is the listed fallback.


Type Literal ​

{ bedrock: BedrockItemRef; kind: "passthrough"; }

Custom content, passed through untouched.


Type Literal ​

{ javaId: string; kind: "unknown"; }

No Bedrock item at all.


Recipe ​

Recipe = ShapedRecipe | ShapelessRecipe | TransmuteRecipe | DyeRecipe | ImbueRecipe | DecoratedPotRecipe | CookingRecipe | StonecuttingRecipe | SmithingTransformRecipe | SmithingTrimRecipe | BrewingRecipe | BannerDuplicateRecipe | BookCloningRecipe | FireworkRocketRecipe | FireworkStarRecipe | FireworkStarFadeRecipe | MapExtendingRecipe | RepairItemRecipe | ShieldDecorationRecipe

Defined in: types.ts:281

One parsed recipe of any of the 22 serializers.


RecipeInput ​

RecipeInput = { grid: CraftingGrid; station: "crafting"; } | { item: RecipeItemStack | null; station: SingleItemStation; } | { addition: RecipeItemStack | null; base: RecipeItemStack | null; station: "smithing"; template: RecipeItemStack | null; } | { input: RecipeItemStack | null; reagent: RecipeItemStack | null; station: "brewing"; }

Defined in: match.ts:34

What a player has placed at a station, ready to be matched against that station's recipes.

Union Members ​

Type Literal ​

{ grid: CraftingGrid; station: "crafting"; }

A crafting grid of the table's or the inventory's declared size.


Type Literal ​

{ item: RecipeItemStack | null; station: SingleItemStation; }

A furnace, blast furnace, smoker, campfire or stonecutter input slot.


Type Literal ​

{ addition: RecipeItemStack | null; base: RecipeItemStack | null; station: "smithing"; template: RecipeItemStack | null; }

The smithing table's three slots, in the order the player sees them.


Type Literal ​

{ input: RecipeItemStack | null; reagent: RecipeItemStack | null; station: "brewing"; }

One brewing stand bottle slot and the reagent above it.


RecipeOfType ​

RecipeOfType<T> = Extract<Recipe, { type: T; }>

Defined in: types.ts:303

The recipe variant a serializer name parses into.

Type Parameters ​

T ​

T extends RecipeType


RecipeStation ​

RecipeStation = typeof RECIPE_STATIONS[number]

Defined in: types.ts:61

One of RECIPE_STATIONS.


RecipeType ​

RecipeType = typeof RECIPE_TYPES[number]

Defined in: types.ts:35

One of RECIPE_TYPES.


TagLookup ​

TagLookup = (registry, tag) => readonly string[] | undefined

Defined in: ingredient.ts:12

Resolves a Java tag to the identifiers it holds, without the leading #. The evaluator asks for the item registry everywhere an ingredient appears and for potion inside a potion component predicate. Return undefined for a tag the server does not know; the caller turns that into a diagnostic rather than an exception.

Parameters ​

registry ​

string

tag ​

string

Returns ​

readonly string[] | undefined

Variables ​

BEDROCK_STATION_TAGS ​

const BEDROCK_STATION_TAGS: object

Defined in: compile.ts:38

The Bedrock block tags that put a recipe in front of a station, from the tags the vanilla Bedrock pack's 1892 recipe files carry (docs/research/bedrock-blocks-items-recipes-biomes-features.md section 4). A campfire recipe carries both campfire tags, which is how Bedrock gives one Java campfire_cooking recipe to both campfire blocks.

Type Declaration ​

blasting ​

readonly blasting: readonly ["blast_furnace"]

brewing ​

readonly brewing: readonly ["brewing_stand"]

campfire_cooking ​

readonly campfire_cooking: readonly ["campfire", "soul_campfire"]

crafting ​

readonly crafting: readonly ["crafting_table"]

smelting ​

readonly smelting: readonly ["furnace"]

smithing ​

readonly smithing: readonly ["smithing_table"]

smoking ​

readonly smoking: readonly ["smoker"]

stonecutting ​

readonly stonecutting: readonly ["stonecutter"]


EMPTY_CONTEXT ​

const EMPTY_CONTEXT: RecipeContext = {}

Defined in: context.ts:36

A context with no lookups, used when a caller passes none.


FIRST_RECIPE_NET_ID ​

const FIRST_RECIPE_NET_ID: 1 = 1

Defined in: order.ts:4

The first network id assigned. Bedrock reserves 0 for "no recipe".


RECIPE_STATIONS ​

const RECIPE_STATIONS: readonly ["crafting", "smelting", "blasting", "smoking", "campfire_cooking", "stonecutting", "smithing", "brewing"]

Defined in: types.ts:49

Java's eight RecipeType values, which is the station a recipe is matched at. Several serializers share one station: the four cooking serializers each have their own, while both smithing serializers share smithing.


RECIPE_TYPES ​

const RECIPE_TYPES: readonly ["minecraft:blasting", "minecraft:brewing", "minecraft:campfire_cooking", "minecraft:crafting_decorated_pot", "minecraft:crafting_dye", "minecraft:crafting_imbue", "minecraft:crafting_shaped", "minecraft:crafting_shapeless", "minecraft:crafting_special_bannerduplicate", "minecraft:crafting_special_bookcloning", "minecraft:crafting_special_firework_rocket", "minecraft:crafting_special_firework_star", "minecraft:crafting_special_firework_star_fade", "minecraft:crafting_special_mapextending", "minecraft:crafting_special_repairitem", "minecraft:crafting_special_shielddecoration", "minecraft:crafting_transmute", "minecraft:smelting", "minecraft:smithing_transform", "minecraft:smithing_trim", "minecraft:smoking", "minecraft:stonecutting"]

Defined in: types.ts:9

Every recipe serializer Java 26.3 registers, read from net.minecraft.world.item.crafting.RecipeSerializers in the 26.3 server jar. Vanilla's 2042 recipe files use all 22.


SPECIAL_RECIPE_TYPES ​

const SPECIAL_RECIPE_TYPES: ("minecraft:blasting" | "minecraft:brewing" | "minecraft:campfire_cooking" | "minecraft:crafting_decorated_pot" | "minecraft:crafting_dye" | "minecraft:crafting_imbue" | "minecraft:crafting_shaped" | "minecraft:crafting_shapeless" | "minecraft:crafting_special_bannerduplicate" | "minecraft:crafting_special_bookcloning" | "minecraft:crafting_special_firework_rocket" | "minecraft:crafting_special_firework_star" | "minecraft:crafting_special_firework_star_fade" | "minecraft:crafting_special_mapextending" | "minecraft:crafting_special_repairitem" | "minecraft:crafting_special_shielddecoration" | "minecraft:crafting_transmute" | "minecraft:smelting" | "minecraft:smithing_transform" | "minecraft:smithing_trim" | "minecraft:smoking" | "minecraft:stonecutting")[]

Defined in: types.ts:42

The eight serializers whose logic lives in Java code rather than in the recipe file. Their JSON names the ingredients; what the craft produces is implemented here, in special.ts.


STATION_BY_TYPE ​

const STATION_BY_TYPE: object

Defined in: types.ts:64

The station each serializer is matched at.

Type Declaration ​

minecraft:blasting ​

readonly minecraft:blasting: "blasting" = 'blasting'

minecraft:brewing ​

readonly minecraft:brewing: "brewing" = 'brewing'

minecraft:campfire_cooking ​

readonly minecraft:campfire_cooking: "campfire_cooking" = 'campfire_cooking'

minecraft:crafting_decorated_pot ​

readonly minecraft:crafting_decorated_pot: "crafting" = 'crafting'

minecraft:crafting_dye ​

readonly minecraft:crafting_dye: "crafting" = 'crafting'

minecraft:crafting_imbue ​

readonly minecraft:crafting_imbue: "crafting" = 'crafting'

minecraft:crafting_shaped ​

readonly minecraft:crafting_shaped: "crafting" = 'crafting'

minecraft:crafting_shapeless ​

readonly minecraft:crafting_shapeless: "crafting" = 'crafting'

minecraft:crafting_special_bannerduplicate ​

readonly minecraft:crafting_special_bannerduplicate: "crafting" = 'crafting'

minecraft:crafting_special_bookcloning ​

readonly minecraft:crafting_special_bookcloning: "crafting" = 'crafting'

minecraft:crafting_special_firework_rocket ​

readonly minecraft:crafting_special_firework_rocket: "crafting" = 'crafting'

minecraft:crafting_special_firework_star ​

readonly minecraft:crafting_special_firework_star: "crafting" = 'crafting'

minecraft:crafting_special_firework_star_fade ​

readonly minecraft:crafting_special_firework_star_fade: "crafting" = 'crafting'

minecraft:crafting_special_mapextending ​

readonly minecraft:crafting_special_mapextending: "crafting" = 'crafting'

minecraft:crafting_special_repairitem ​

readonly minecraft:crafting_special_repairitem: "crafting" = 'crafting'

minecraft:crafting_special_shielddecoration ​

readonly minecraft:crafting_special_shielddecoration: "crafting" = 'crafting'

minecraft:crafting_transmute ​

readonly minecraft:crafting_transmute: "crafting" = 'crafting'

minecraft:smelting ​

readonly minecraft:smelting: "smelting" = 'smelting'

minecraft:smithing_transform ​

readonly minecraft:smithing_transform: "smithing" = 'smithing'

minecraft:smithing_trim ​

readonly minecraft:smithing_trim: "smithing" = 'smithing'

minecraft:smoking ​

readonly minecraft:smoking: "smoking" = 'smoking'

minecraft:stonecutting ​

readonly minecraft:stonecutting: "stonecutting" = 'stonecutting'

Functions ​

assignNetIds() ​

assignNetIds(recipes): ReadonlyMap<string, number>

Defined in: order.ts:43

Assigns a network id to every recipe, numbering the ordered list from FIRST_RECIPE_NET_ID. Adding a recipe renumbers every recipe that sorts after it, so a client that has cached ids has to be sent a fresh recipe list after a reload.

Parameters ​

recipes ​

readonly Recipe[]

Returns ​

ReadonlyMap<string, number>


compareRecipeIds() ​

compareRecipeIds(left, right): number

Defined in: order.ts:21

Orders two recipe identifiers by namespace first, then by path, comparing code units rather than collating. localeCompare would put the same two recipes in different orders on different machines, and network ids that depend on the order have to be reproducible.

Parameters ​

left ​

string

right ​

string

Returns ​

number


compileRecipeBook() ​

compileRecipeBook(book, mapper): RecipeCompileReport

Defined in: compile.ts:216

Compiles every recipe in a book, keeping the book's network ids.

Parameters ​

book ​

RecipeBook

mapper ​

JavaItemMapper

Returns ​

RecipeCompileReport


compileRecipes() ​

compileRecipes(recipes, mapper): RecipeCompileReport

Defined in: compile.ts:151

Translates recipes to Bedrock identifiers through an injected mapper and numbers them from registry order.

Nothing is dropped silently. A reviewed loss keeps the recipe and is listed in losses. An identifier with no Bedrock item is listed in gaps; it costs the whole recipe only when it is the result or when it empties an ingredient, and those recipes are named in dropped.

Parameters ​

recipes ​

Iterable<Recipe>

Parsed recipes, or a RecipeBook's recipes list.

mapper ​

JavaItemMapper

The Java-to-Bedrock item lookup, such as javaItemToBedrock from @jsprismarine/mapping.

Returns ​

RecipeCompileReport


createRecipeBook() ​

createRecipeBook(recipes, context?): RecipeBook

Defined in: book.ts:39

Builds a recipe book from parsed recipes. Two recipes with the same identifier collapse to the last one given, which is how a later datapack overrides an earlier one.

Parameters ​

recipes ​

Iterable<Recipe>

context? ​

RecipeContext = EMPTY_CONTEXT

Injected registry lookups, passed on to every match.

Returns ​

RecipeBook


cropGrid() ​

cropGrid(grid): CroppedGrid

Defined in: grid.ts:37

Shrinks a grid to the bounding box of its filled slots. Every recipe matcher works on the cropped grid, so a recipe never has to describe where in the table the player placed its items.

Parameters ​

grid ​

CraftingGrid

Returns ​

CroppedGrid


filledSlots() ​

filledSlots(grid): readonly object[]

Defined in: grid.ts:70

Every filled slot of a cropped grid, paired with its index inside that grid.

Parameters ​

grid ​

CroppedGrid

Returns ​

readonly object[]


gridAt() ​

gridAt(grid, x, y): RecipeItemStack | null

Defined in: grid.ts:27

Reads the slot at a column and row, or null when the coordinates fall outside the grid.

Parameters ​

grid ​

CraftingGrid

x ​

number

y ​

number

Returns ​

RecipeItemStack | null


ingredientAccepts() ​

ingredientAccepts(ingredient, stack): boolean

Defined in: ingredient.ts:196

Whether a stack satisfies the ingredient: its identifier is one the ingredient accepts and every component predicate holds. Count is not considered, because each ingredient consumes one item from its slot.

Parameters ​

ingredient ​

Ingredient

stack ​

RecipeItemStack | null

Returns ​

boolean


isEmptyIngredient() ​

isEmptyIngredient(ingredient): boolean

Defined in: ingredient.ts:208

An ingredient that accepts nothing, which is what an unresolved tag leaves behind.

Parameters ​

ingredient ​

Ingredient

Returns ​

boolean


loadRecipes() ​

loadRecipes(files, context?): RecipeLoadResult

Defined in: book.ts:176

Parses a set of recipe files and builds a book from the ones that read. A file with an error is left out and named in failed; the rest load, so one broken datapack file does not take the server down.

Parameters ​

files ​

Iterable<readonly [string, unknown]>

Recipe identifier to parsed recipe JSON, such as the recipesJava map @jsprismarine/packs produces.

context? ​

RecipeContext = EMPTY_CONTEXT

Returns ​

RecipeLoadResult


matchRecipe() ​

matchRecipe(recipe, input, context?): RecipeMatch | undefined

Defined in: match.ts:249

Whether one recipe accepts one station input, and what it produces.

A crafting grid is cropped to the bounding box of its filled slots first, the way Java's CraftingInput is, so a recipe matches wherever in the table the player placed its items. Shaped patterns are then tried at every remaining offset and in both the written and the mirrored arrangement.

Parameters ​

recipe ​

Recipe

input ​

RecipeInput

context? ​

RecipeContext = EMPTY_CONTEXT

Injected registry lookups; RecipeContext says what each one enables.

Returns ​

RecipeMatch | undefined

The match, or undefined when the recipe does not accept the input.


normalizeIdentifier() ​

normalizeIdentifier(id): string

Defined in: itemStack.ts:54

Prefixes a bare identifier with minecraft:. Java accepts both forms everywhere an identifier appears, and vanilla recipe files use the prefixed form throughout.

Parameters ​

id ​

string

Returns ​

string


orderRecipes() ​

orderRecipes(recipes): readonly Recipe[]

Defined in: order.ts:34

Sorts recipes into the order the registry publishes them in. The plan takes recipe network ids from registry order, so this order is the one thing in the package that a client sees indirectly: it has to be a pure function of the loaded identifiers and nothing else, which rules out load order, file system order and insertion order.

Parameters ​

recipes ​

Iterable<Recipe>

Returns ​

readonly Recipe[]


parseIngredient() ​

parseIngredient(value, path, tags?): IngredientParseResult

Defined in: ingredient.ts:114

Parses one ingredient in any of the four forms Java 26.3 accepts: an item identifier, a #tag, a list of either, or an inline object naming an item plus component predicates.

Tag members come from tags; an unresolved tag contributes no items and raises a warning rather than throwing, because recipe files are untrusted input.

Parameters ​

value ​

unknown

path ​

string

Dotted path to the field, used in diagnostics.

tags? ​

TagLookup

Returns ​

IngredientParseResult


parseRecipe() ​

parseRecipe(id, source, tags?): RecipeParseResult

Defined in: parse.ts:237

Parses one Java recipe file into a Recipe. Handles all 22 of Java 26.3's serializers; an unknown type is reported as an error rather than throwing, because recipe files are untrusted input.

Ingredient tags resolve through tags at parse time, which is where Java resolves them too: a tag reload rebuilds the recipe set.

Parameters ​

id ​

string

The recipe's identifier, which is its datapack path without the extension.

source ​

unknown

The parsed recipe JSON.

tags? ​

TagLookup

Returns ​

RecipeParseResult


rangeContains() ​

rangeContains(range, value): boolean

Defined in: itemStack.ts:36

Whether value falls inside the inclusive range.

Parameters ​

range ​

IntRange

value ​

number

Returns ​

boolean


recipeIngredients() ​

recipeIngredients(recipe): readonly (Ingredient | null)[]

Defined in: types.ts:311

Every ingredient a recipe declares, in the order the compile step and the recipe book expose them. A shaped recipe yields its pattern cells in row-major order, with null for an empty cell; every other recipe yields its ingredient fields in the order the serializer declares them.

Parameters ​

recipe ​

Recipe

Returns ​

readonly (Ingredient | null)[]


recipeResult() ​

recipeResult(recipe): ItemStackTemplate | undefined

Defined in: types.ts:360

The result the recipe declares, or undefined when it has none to declare. The repair recipe names no result at all, and map cloning and map extending write "result": {} because the result is built from the input map.

Parameters ​

recipe ​

Recipe

Returns ​

ItemStackTemplate | undefined


shapedPatternMatches() ​

shapedPatternMatches(pattern, grid): boolean

Defined in: shaped.ts:47

Whether a shaped pattern matches a grid, trying every offset placement and both the written and the left-right mirrored arrangement, which is what Java's ShapedRecipePattern.matches does.

Pass the cropped grid: Java crops the crafting input to the bounding box of its filled slots before matching, which is what makes a 2x2 recipe work in any corner of a 3x3 table. The offset loop then only has room to move when the pattern is smaller than the cropped grid, which happens when the pattern itself has empty border cells.

Parameters ​

pattern ​

ShapedPattern

grid ​

CraftingGrid

Returns ​

boolean


stackFromTemplate() ​

stackFromTemplate(template, id, count?): RecipeItemStack

Defined in: itemStack.ts:39

Builds a stack from a template, keeping the template's count and components.

Parameters ​

template ​

ItemStackTemplate

id ​

string

count? ​

number = template.count

Returns ​

RecipeItemStack