Recipes
To create recipes with Kore, you can utilize the framework's built-in functions to define various types of recipes for your Minecraft data packs. Here's a comprehensive guide on how to create different recipes using Kore:
Set Up Your Data Pack Function
Begin by creating a function within your DataPack
where you'll define your recipes:
Initialize the Recipes Block
Use the recipes
block to start defining your recipes:
Creating a Blasting Recipe
To create a blasting recipe, use the blasting
function:
Note that campfire
, smelting
, and smoking
recipes can be defined similarly using the respective functions.
Crafting Shaped Recipes
For crafting recipes with a specific shape:
Crafting Shapeless Recipes
For recipes where the arrangement doesn't matter:
Special Crafting Recipes
In addition to standard crafting recipes, crafting special recipes leverage built-in game logic to handle complex crafting operations that regular data-driven recipes cannot manage. These special recipes are essential for functionalities that require handling NBT (Named Binary Tag) data, multiple inputs, or specific item interactions. They are particularly useful when the "vanilla" data pack is disabled, allowing you to re-enable and customize desired built-in crafting behaviors.
Available Special Recipe Types
Here is a list of available special recipe types and their functionalities:
armordye
: Dyeing armor with multiple dyes.bannerduplicate
: Copying NBT data from one banner to another.bookcloning
: Cloning written books, including their NBT data.firework_rocket
: Crafting firework rockets with flexible inputs and NBT data from firework stars.firework_star
: Crafting firework stars and adding fade colors.firework_star_fade
: Adding fade colors to firework stars.mapcloning
: Copying maps along with their NBT data.mapextending
: Zooming maps by updating their NBT data.repairitem
: Repairing items by updating their damage data.shielddecoration
: Applying shield patterns using banner NBT data.shulkerboxcoloring
: Dyeing shulker boxes while preserving their NBT data.tippedarrow
: Crafting tipped arrows with NBT data from lingering potions.suspiciousstew
: Creating suspicious stew with specific status effects based on flower types.
Defining a Special Recipe
To define a special crafting recipe, use the craftingSpecial function with the specific type and relevant parameters. Below are examples of how to define some of the special recipes:
Smithing Transform Recipes
To create a smithing transformation recipe:
Smithing Trim Recipes
For smithing trim recipes:
Stonecutting Recipes
To define a stonecutting recipe:
Defining Ingredients
Ingredients can be items or tags, and you can define them as follows:
You also have a shorter form for defining an ingredient:
Setting the Result
When specifying the result of a recipe:
Using Keys in Shaped Recipes
Map characters in your pattern to specific items:
Adding Experience and Cooking Time
For recipes that require cooking:
Loading and Giving Recipes
To load the recipes and make them available:
Utilizing Built-in Recipe Types
Kore provides a variety of built-in recipe types through RecipeTypes
:
RecipeTypes.BLASTING
RecipeTypes.CAMPFIRE_COOKING
RecipeTypes.CRAFTING_SHAPED
RecipeTypes.CRAFTING_SHAPELESS
RecipeTypes.CRAFTING_SPECIAL
RecipeTypes.SMELTING
RecipeTypes.SMITHING_TRANSFORM
RecipeTypes.SMITHING_TRIM
RecipeTypes.SMOKING
RecipeTypes.STONECUTTING
Custom Components
You can customize items using components, but for now Minecraft only allows components on results:
Full Example
Here's a full example putting it all together:
Reference Recipes in Commands
To reference recipes in commands, you can use the recipeBuilder
property and store the recipe inside a variable:
Additional Tips
- Grouping Recipes: You can assign a group to recipes, prefer using it when recipes have the same result.
- Tags: Use tags to reference multiple items sharing the same tag.
- Components: Modify result items with components like
damage
,enchantments
, etc.
All recipes are stored inside Datapack.recipes
list, if you ever need to access them programmatically.
By following this guide, you can create complex and customized recipes in your Minecraft data pack using the Kore framework. Be sure to explore the Kore documentation and source code further to take full advantage of its capabilities.