Represent minecraft recipes
npm install prismarine-recipe
Represent minecraft recipes
``js
const Recipe=require("prismarine-recipe")("1.8").Recipe;
console.log(JSON.stringify(Recipe.find(5)[0],null,2)); // recipes for wood
`
#### Recipe.find(itemType, [metadata])
Returns a list of matching Recipe instances.
* itemType - numerical idmetadata
* - metadata to match. null means match anything.
#### recipe.result
The output item. It's a recipeItem :
`js`
{
id:45,
metadata:3,
count:1
}
#### recipe.inShape
Looks like this:
`js`
[
[recipeItem, recipeItem],
[recipeItem, recipeItem],
[recipeItem, recipeItem],
]
#### recipe.outShape
Looks the same as inShape. Only relevant for cake.
#### recipe.ingredients
List of shape-independent ingredients. Looks like this:
`js`
[
recipeItem,
recipeItem
]
#### recipe.requiresTable
Boolean.
#### recipe.delta
Map of item type to how much more or less you will have after you use
the recipe.
This is what it looks like for the chest recipe:
`js``
[
recipeItem,
recipeItem
]
* mcData to registry refactoring (@Epirito)
* Fixed RecipeItemConstructor Type and default export (@psu-de)
* Bump mcdata
* typescript definitions (thanks @IdanHo)
* bump mcdata
* bump dependencies
* Import from mineflayer