Interface Recipe<C extends Inventory>

All Known Subinterfaces:
CraftingRecipe
All Known Implementing Classes:
AbstractCookingRecipe, ArmorDyeRecipe, BannerDuplicateRecipe, BlastingRecipe, BookCloningRecipe, CampfireCookingRecipe, CuttingRecipe, FireworkRocketRecipe, FireworkStarFadeRecipe, FireworkStarRecipe, MapCloningRecipe, MapExtendingRecipe, RepairItemRecipe, ShapedRecipe, ShapelessRecipe, ShieldDecorationRecipe, ShulkerBoxColoringRecipe, SmeltingRecipe, SmithingRecipe, SmokingRecipe, SpecialCraftingRecipe, StonecuttingRecipe, SuspiciousStewRecipe, TippedArrowRecipe

public interface Recipe<C extends Inventory>
  • Method Details

    • matches

      boolean matches​(C inventory, World world)
      Determines whether this recipe matches the contents currently placed inside the available crafting grid.
    • craft

      ItemStack craft​(C inventory)
      Crafts this recipe.

      This method may perform side effects on the inventory argument.

      This method should return a new item stack on each call.

      Returns:
      the resulting item stack
    • fits

      @Environment(CLIENT) boolean fits​(int width, int height)
      Determines whether this recipe's pattern will fit into the available crafting area.
    • getOutput

      ItemStack getOutput()
    • getRemainder

      default DefaultedList<ItemStack> getRemainder​(C inventory)
      Returns the remaining stacks to be left in the crafting grid after crafting is complete. Should return the same number of items as the input grid contains in the same order they're expected to appear in that grid.
    • getIngredients

      default DefaultedList<Ingredient> getIngredients()
      The ingredients accepted as inputs for this recipe. Used by the recipe book when displaying a ghost form of this recipe on the crafting grid as well as for previewing the possible inputs in the book itself.
    • isIgnoredInRecipeBook

      default boolean isIgnoredInRecipeBook()
    • getGroup

      @Environment(CLIENT) default String getGroup()
      Optional group this recipe belongs in. Used to group recipes into different categories by the recipe book.
    • createIcon

      @Environment(CLIENT) default ItemStack createIcon()
      Creates the stack that is displayed on the recipe book tab containing this recipe, and on a toast when a recipe of this type is unlocked. Used in conjunction with getGroup().
    • getId

      Identifier getId()
    • getSerializer

      RecipeSerializer<?> getSerializer()
    • getType

      RecipeType<?> getType()