Skip to content

API reference / @jsprismarine/prismarine / crafting/javaItemId

crafting/javaItemId ​

Functions ​

javaItemIdOf() ​

javaItemIdOf(identifier, meta?): string | undefined

Defined in: packages/prismarine/src/crafting/javaItemId.ts:14

Resolves a Bedrock item identifier and legacy data value to the Java item a recipe names.

data on a uniquely named Bedrock item is its legacy wire value, not a selector: birch planks remain birch planks even when the stack's metadata is zero. Only an identifier several Java items share needs the value to pick one of them. An identifier outside the minecraft namespace is custom content and is its own Java identifier.

Parameters ​

identifier ​

string

meta? ​

number = 0

Returns ​

string | undefined

The Java identifier, or undefined for a vanilla item, or a variant of one, that no Java item matches.


javaItemIdsOf() ​

javaItemIdsOf(identifier): readonly string[]

Defined in: packages/prismarine/src/crafting/javaItemId.ts:30

Every Java item a Bedrock identifier stands for whatever its data value, which is what a recipe ingredient that names no data value accepts.

Parameters ​

identifier ​

string

Returns ​

readonly string[]