Package org.bukkit.inventory

# Class ShapelessRecipe

java.lang.Object
org.bukkit.inventory.ShapelessRecipe

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

public class ShapelessRecipe extends Object implements Recipe, Keyed
Represents a shapeless recipe, where the arrangement of the ingredients on the crafting grid does not matter.

## Constructor Summary

Constructors
Constructor
Description
`ShapelessRecipe(@NotNull ItemStack result)`
Deprecated.
`ShapelessRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result)`
Create a shapeless recipe to craft the specified ItemStack.

## Method Summary

Modifier and Type
Method
Description
`@NotNull ShapelessRecipe`
`addIngredient(int count, @NotNull ItemStack item)`
`@NotNull ShapelessRecipe`
`addIngredient(int count, @NotNull Material ingredient)`
Adds multiples of the specified ingredient.
`@NotNull ShapelessRecipe`
`addIngredient(int count, @NotNull MaterialData ingredient)`
Deprecated.
use `addIngredient(int, Material)`
`@NotNull ShapelessRecipe`
`addIngredient(int count, @NotNull Material ingredient, int rawdata)`
Deprecated.
Magic value
`@NotNull ShapelessRecipe`
`addIngredient(@NotNull ItemStack item)`
`@NotNull ShapelessRecipe`
`addIngredient(@NotNull RecipeChoice ingredient)`
`@NotNull ShapelessRecipe`
`addIngredient(@NotNull Material ingredient)`
Adds the specified ingredient.
`@NotNull ShapelessRecipe`
`addIngredient(@NotNull MaterialData ingredient)`
Deprecated.
use `addIngredient(RecipeChoice)`
`@NotNull ShapelessRecipe`
`addIngredient(@NotNull Material ingredient, int rawdata)`
Deprecated.
Magic value
`@NotNull List<RecipeChoice>`
`getChoiceList()`
`@NotNull String`
`getGroup()`
Get the group of this recipe.
`@NotNull List<ItemStack>`
`getIngredientList()`
Get the list of ingredients used for this recipe.
`@NotNull NamespacedKey`
`getKey()`
Return the namespaced identifier for this object.
`@NotNull ItemStack`
`getResult()`
Get the result of this recipe.
`@NotNull ShapelessRecipe`
`removeIngredient(int count, @NotNull ItemStack item)`
`@NotNull ShapelessRecipe`
`removeIngredient(int count, @NotNull Material ingredient)`
Removes multiple instances of an ingredient from the list.
`@NotNull ShapelessRecipe`
`removeIngredient(int count, @NotNull MaterialData ingredient)`
Deprecated.
use `removeIngredient(int, Material)`
`@NotNull ShapelessRecipe`
`removeIngredient(int count, @NotNull Material ingredient, int rawdata)`
Deprecated.
Magic value
`@NotNull ShapelessRecipe`
`removeIngredient(@NotNull ItemStack item)`
`@NotNull ShapelessRecipe`
`removeIngredient(@NotNull RecipeChoice ingredient)`
Removes an ingredient from the list.
`@NotNull ShapelessRecipe`
`removeIngredient(@NotNull Material ingredient)`
Removes an ingredient from the list.
`@NotNull ShapelessRecipe`
`removeIngredient(@NotNull MaterialData ingredient)`
Deprecated.
use `removeIngredient(Material)`
`@NotNull ShapelessRecipe`
`removeIngredient(@NotNull Material ingredient, int rawdata)`
Deprecated.
Magic value
`void`
`setGroup(@NotNull String group)`
Set the group of this recipe.

### 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

### ShapelessRecipe

@Deprecated public ShapelessRecipe(@NotNull @NotNull ItemStack result)
Deprecated.

### ShapelessRecipe

public ShapelessRecipe(@NotNull @NotNull NamespacedKey key, @NotNull @NotNull ItemStack result)
Create a shapeless recipe to craft the specified ItemStack. The constructor merely determines the result and type; to set the actual recipe, you'll need to call the appropriate methods.

Parameters:
  `key` - the unique recipe key
  `result` - The item you want the recipe to create.
See Also:
  - `addIngredient(Material)`
  - `addIngredient(MaterialData)`
  - `addIngredient(Material,int)`
  - `addIngredient(int,Material)`
  - `addIngredient(int,MaterialData)`
  - `addIngredient(int,Material,int)`

## Method Details

### addIngredient

@NotNull @Deprecated public @NotNull ShapelessRecipe addIngredient(@NotNull @NotNull MaterialData ingredient)
Deprecated.
use `addIngredient(RecipeChoice)`
Adds the specified ingredient.

Parameters:
  `ingredient` - The ingredient to add.
Returns:
  The changed recipe, so you can chain calls.

### addIngredient

@NotNull public @NotNull ShapelessRecipe addIngredient(@NotNull @NotNull Material ingredient)
Adds the specified ingredient.

Parameters:
  `ingredient` - The ingredient to add.
Returns:
  The changed recipe, so you can chain calls.

### addIngredient

@Deprecated @NotNull public @NotNull ShapelessRecipe addIngredient(@NotNull @NotNull Material ingredient, int rawdata)
Deprecated.
Magic value
Adds the specified ingredient.

Parameters:
  `ingredient` - The ingredient to add.
  `rawdata` - The data value, or -1 to allow any data value.
Returns:
  The changed recipe, so you can chain calls.

### addIngredient

@NotNull @Deprecated public @NotNull ShapelessRecipe addIngredient(int count, @NotNull @NotNull MaterialData ingredient)
Deprecated.
use `addIngredient(int, Material)`
Adds multiples of the specified ingredient.

Parameters:
  `count` - How many to add (can't be more than 9!)
  `ingredient` - The ingredient to add.
Returns:
  The changed recipe, so you can chain calls.

### addIngredient

@NotNull public @NotNull ShapelessRecipe addIngredient(int count, @NotNull @NotNull Material ingredient)
Adds multiples of the specified ingredient.

Parameters:
  `count` - How many to add (can't be more than 9!)
  `ingredient` - The ingredient to add.
Returns:
  The changed recipe, so you can chain calls.

### addIngredient

@Deprecated @NotNull public @NotNull ShapelessRecipe addIngredient(int count, @NotNull @NotNull Material ingredient, int rawdata)
Deprecated.
Magic value
Adds multiples of the specified ingredient.

Parameters:
  `count` - How many to add (can't be more than 9!)
  `ingredient` - The ingredient to add.
  `rawdata` - The data value, or -1 to allow any data value.
Returns:
  The changed recipe, so you can chain calls.

### addIngredient

@NotNull public @NotNull ShapelessRecipe addIngredient(@NotNull @NotNull RecipeChoice ingredient)

### addIngredient

@NotNull public @NotNull ShapelessRecipe addIngredient(@NotNull @NotNull ItemStack item)

### addIngredient

@NotNull public @NotNull ShapelessRecipe addIngredient(int count, @NotNull @NotNull ItemStack item)

### removeIngredient

@NotNull public @NotNull ShapelessRecipe removeIngredient(@NotNull @NotNull ItemStack item)

### removeIngredient

@NotNull public @NotNull ShapelessRecipe removeIngredient(int count, @NotNull @NotNull ItemStack item)

### removeIngredient

@NotNull public @NotNull ShapelessRecipe removeIngredient(@NotNull @NotNull RecipeChoice ingredient)
Removes an ingredient from the list.

Parameters:
  `ingredient` - The ingredient to remove
Returns:
  The changed recipe.

### removeIngredient

@NotNull public @NotNull ShapelessRecipe removeIngredient(@NotNull @NotNull Material ingredient)
Removes an ingredient from the list. If the ingredient occurs multiple times, only one instance of it is removed. Only removes exact matches, with a data value of 0.

Parameters:
  `ingredient` - The ingredient to remove
Returns:
  The changed recipe.

### removeIngredient

@NotNull @Deprecated public @NotNull ShapelessRecipe removeIngredient(@NotNull @NotNull MaterialData ingredient)
Deprecated.
use `removeIngredient(Material)`
Removes an ingredient from the list. If the ingredient occurs multiple times, only one instance of it is removed. If the data value is -1, only ingredients with a -1 data value will be removed.

Parameters:
  `ingredient` - The ingredient to remove
Returns:
  The changed recipe.

### removeIngredient

@NotNull public @NotNull ShapelessRecipe removeIngredient(int count, @NotNull @NotNull Material ingredient)
Removes multiple instances of an ingredient from the list. If there are less instances then specified, all will be removed. Only removes exact matches, with a data value of 0.

Parameters:
  `count` - The number of copies to remove.
  `ingredient` - The ingredient to remove
Returns:
  The changed recipe.

### removeIngredient

@NotNull @Deprecated public @NotNull ShapelessRecipe removeIngredient(int count, @NotNull @NotNull MaterialData ingredient)
Deprecated.
use `removeIngredient(int, Material)`
Removes multiple instances of an ingredient from the list. If there are less instances then specified, all will be removed. If the data value is -1, only ingredients with a -1 data value will be removed.

Parameters:
  `count` - The number of copies to remove.
  `ingredient` - The ingredient to remove.
Returns:
  The changed recipe.

### removeIngredient

@Deprecated @NotNull public @NotNull ShapelessRecipe removeIngredient(@NotNull @NotNull Material ingredient, int rawdata)
Deprecated.
Magic value
Removes an ingredient from the list. If the ingredient occurs multiple times, only one instance of it is removed. If the data value is -1, only ingredients with a -1 data value will be removed.

Parameters:
  `ingredient` - The ingredient to remove
  `rawdata` - The data value;
Returns:
  The changed recipe.

### removeIngredient

@Deprecated @NotNull public @NotNull ShapelessRecipe removeIngredient(int count, @NotNull @NotNull Material ingredient, int rawdata)
Deprecated.
Magic value
Removes multiple instances of an ingredient from the list. If there are less instances then specified, all will be removed. If the data value is -1, only ingredients with a -1 data value will be removed.

Parameters:
  `count` - The number of copies to remove.
  `ingredient` - The ingredient to remove.
  `rawdata` - The data value.
Returns:
  The changed recipe.

### getResult

@NotNull public @NotNull ItemStack getResult()
Get the result of this recipe.

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

### getIngredientList

@NotNull public @NotNull List<ItemStack> getIngredientList()
Get the list of ingredients used for this recipe.

Returns:
  The input list

### getChoiceList

@NotNull public @NotNull List<RecipeChoice> getChoiceList()

### 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

### getGroup

@NotNull public @NotNull String getGroup()
Get the group of this recipe. Recipes with the same group may be grouped together when displayed in the client.

Returns:
  recipe group. An empty string denotes no group. May not be null.

### setGroup

public void setGroup(@NotNull @NotNull String group)
Set the group of this recipe. Recipes with the same group may be grouped together when displayed in the client.

Parameters:
  `group` - recipe group. An empty string denotes no group. May not be null.