Package org.bukkit.inventory

# Class SmithingRecipe

java.lang.Object
org.bukkit.inventory.SmithingRecipe

All Implemented Interfaces:
  `net.kyori.adventure.key.Keyed`, `Recipe`, `Keyed`

public class SmithingRecipe extends Object implements Recipe, Keyed
Represents a smithing recipe.

## Constructor Summary

Constructors
Constructor
Description
`SmithingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice base, @NotNull RecipeChoice addition)`
Create a smithing recipe to produce the specified result ItemStack.
`SmithingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice base, @NotNull RecipeChoice addition, boolean copyNbt)`
Create a smithing recipe to produce the specified result ItemStack.

## Method Summary

Modifier and Type
Method
Description
`@NotNull RecipeChoice`
`getAddition()`
Get the addition recipe item.
`@NotNull RecipeChoice`
`getBase()`
Get the base recipe item.
`@NotNull NamespacedKey`
`getKey()`
Return the namespaced identifier for this object.
`@NotNull ItemStack`
`getResult()`
Get the result of this recipe.
`boolean`
`willCopyNbt()`
Whether or not to copy the NBT of the input base item to the output.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.bukkit.Keyed

`key`

## Constructor Details

### SmithingRecipe

public SmithingRecipe(@NotNull @NotNull NamespacedKey key, @NotNull @NotNull ItemStack result, @NotNull @NotNull RecipeChoice base, @NotNull @NotNull RecipeChoice addition)
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

public SmithingRecipe(@NotNull @NotNull NamespacedKey key, @NotNull @NotNull ItemStack result, @NotNull @NotNull RecipeChoice base, @NotNull @NotNull RecipeChoice addition, boolean copyNbt)
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
  `copyNbt` - whether to copy the nbt from the input base item to the output

## Method Details

### getBase

@NotNull public @NotNull RecipeChoice getBase()
Get the base recipe item.

Returns:
  base choice

### getAddition

@NotNull public @NotNull RecipeChoice getAddition()
Get the addition recipe item.

Returns:
  addition choice

### getResult

@NotNull public @NotNull ItemStack getResult()
Description copied from interface: `Recipe`
Get the result of this recipe.

Specified by:
  `getResult` in interface `Recipe`
Returns:
  The result stack

### getKey

@NotNull public @NotNull NamespacedKey getKey()
Description copied from interface: `Keyed`
Return the namespaced identifier for this object.

Specified by:
  `getKey` in interface `Keyed`
Returns:
  this object's key

### willCopyNbt

public boolean willCopyNbt()
Whether or not to copy the NBT of the input base item to the output.

Returns:
  true to copy the NBT (default for vanilla smithing recipes)