Class TransmuteRecipe

java.lang.Object
org.bukkit.inventory.CraftingRecipe
org.bukkit.inventory.TransmuteRecipe
All Implemented Interfaces:
ComplexRecipe, Recipe, Keyed

public class TransmuteRecipe extends CraftingRecipe implements ComplexRecipe
Represents a recipe which will change the type of the input material when combined with an additional material, but preserve all custom data. Only the item type of the result stack will be used.
Used for dyeing shulker boxes in Vanilla.
  • Constructor Details

    • TransmuteRecipe

      public TransmuteRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input, @NotNull RecipeChoice material, int minimumMaterialCount, int maximumMaterialCount, boolean addMaterialCountToResult)
      Create a transmute recipe to produce a result of the specified type.
      Parameters:
      key - the unique recipe key
      result - the transmuted result item
      input - the input ingredient
      material - the additional ingredient
      minimumMaterialCount - minimum count of the material, default 1, range [1, 8]
      maximumMaterialCount - maximum count of the material, default 1, range [1, 8]
      addMaterialCountToResult - whether the material count should be added to the result stack count, default false
    • TransmuteRecipe

      public TransmuteRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice input, @NotNull RecipeChoice material)
      Create a transmute recipe to produce a result of the specified type.
      Parameters:
      key - the unique recipe key
      result - the transmuted result item
      input - the input ingredient
      material - the additional ingredient
    • TransmuteRecipe

      public TransmuteRecipe(@NotNull NamespacedKey key, @NotNull Material result, @NotNull RecipeChoice input, @NotNull RecipeChoice material)
      Create a transmute recipe to produce a result of the specified type.
      Parameters:
      key - the unique recipe key
      result - the transmuted result material
      input - the input ingredient
      material - the additional ingredient
  • Method Details

    • getInput

      @NotNull public RecipeChoice getInput()
      Gets the input material, which will be transmuted.
      Returns:
      the input from transmutation
    • getMaterial

      @NotNull public RecipeChoice getMaterial()
      Gets the additional material required to cause the transmutation.
      Returns:
      the ingredient material
    • getMinimumMaterialCount

      public int getMinimumMaterialCount()
      Gets the minimum amount of items matched by the material ingredient.
      Returns:
      minimum count of the material, default 1, range [1, 8]
    • getMaximumMaterialCount

      public int getMaximumMaterialCount()
      Gets the maximum amount of items matched by the material ingredient.
      Returns:
      maximum count of the material, default 1, range [1, 8]
    • isAddMaterialCountToResult

      public boolean isAddMaterialCountToResult()
      Gets whether the material ingredient count should be added to the result stack count after crafting.
      Returns:
      whether the material ingredient count should be added to the result stack count, default false