Package org.bukkit.inventory
Class SmithingRecipe
java.lang.Object
org.bukkit.inventory.SmithingRecipe
- Direct Known Subclasses:
- SmithingTransformRecipe,- SmithingTrimRecipe
Represents a smithing recipe.
- 
Constructor SummaryConstructorsConstructorDescriptionSmithingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @Nullable RecipeChoice base, @Nullable RecipeChoice addition) Deprecated.SmithingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @Nullable RecipeChoice base, @Nullable RecipeChoice addition, boolean copyDataComponents) Deprecated.
- 
Method SummaryModifier and TypeMethodDescriptionGet the addition recipe item.getBase()Get the base recipe item.getKey()Return the namespaced identifier for this object.Get the result of this recipe.booleanWhether to copy the data components of the input base item to the output.booleanWhether to copy the NBT of the input base item to the output.
- 
Constructor Details- 
SmithingRecipe@Deprecated(since="1.20.1") public SmithingRecipe(@NotNull @NotNull NamespacedKey key, @NotNull @NotNull ItemStack result, @Nullable @Nullable RecipeChoice base, @Nullable @Nullable RecipeChoice addition) Deprecated.as of Minecraft 1.20, smithing recipes are now separated into two distinct recipe types,SmithingTransformRecipeandSmithingTrimRecipe. This class now acts as a base class to these two classes and will do nothing when added to the server.Create a smithing recipe to produce the specified result ItemStack.- Parameters:
- key- The unique recipe key
- result- The item you want the recipe to create.
- base- The base ingredient
- addition- The addition ingredient
 
- 
SmithingRecipe@Deprecated public SmithingRecipe(@NotNull @NotNull NamespacedKey key, @NotNull @NotNull ItemStack result, @Nullable @Nullable RecipeChoice base, @Nullable @Nullable RecipeChoice addition, boolean copyDataComponents) Deprecated.Create a smithing recipe to produce the specified result ItemStack.- Parameters:
- key- The unique recipe key
- result- The item you want the recipe to create.
- base- The base ingredient
- addition- The addition ingredient
- copyDataComponents- whether to copy the data components from the input base item to the output
 
 
- 
- 
Method Details- 
getBaseGet the base recipe item.- Returns:
- base choice
 
- 
getAdditionGet the addition recipe item.- Returns:
- addition choice
 
- 
getResultDescription copied from interface:RecipeGet the result of this recipe.
- 
getKeyDescription copied from interface:KeyedReturn the namespaced identifier for this object.
- 
willCopyNbtWhether to copy the NBT of the input base item to the output.- Returns:
- true to copy the NBT (default for vanilla smithing recipes)
- API Note:
- use willCopyDataComponents()
 
- 
willCopyDataComponentspublic boolean willCopyDataComponents()Whether to copy the data components of the input base item to the output.- Returns:
- true to copy the data components (default for vanilla smithing recipes)
 
 
- 
SmithingTransformRecipeandSmithingTrimRecipe.