Interface Recipe<T extends RecipeInput>

All Known Subinterfaces:
CraftingRecipe, SmithingRecipe
All Known Implementing Classes:
AbstractCookingRecipe, ArmorDyeRecipe, BannerDuplicateRecipe, BlastingRecipe, BookCloningRecipe, CampfireCookingRecipe, CraftingDecoratedPotRecipe, FireworkRocketRecipe, FireworkStarFadeRecipe, FireworkStarRecipe, MapCloningRecipe, MapExtendingRecipe, RepairItemRecipe, ShapedRecipe, ShapelessRecipe, ShieldDecorationRecipe, SingleStackRecipe, SmeltingRecipe, SmithingTransformRecipe, SmithingTrimRecipe, SmokingRecipe, SpecialCraftingRecipe, StonecuttingRecipe, TippedArrowRecipe, TransmuteRecipe

public interface Recipe<T extends RecipeInput>
A recipe is an arrangement of items in an inventory that can yield a product item stack. Recipes are not used on the client side; the server syncs to the client a RecipeDisplayEntry, which is used instead.

Recipes are loaded by and stored in the ServerRecipeManager. They are part of the server's data packs. Hence, recipes should not be stored, as they may become obsolete after reloads.

RecipeEntry is a pair of the recipe and its ID (a registry key). The ID can be used to refer to recipes in saved data. However, the client does not receive the ID of recipes.

A few of the methods in this class are dedicated to crafting recipes or recipe books. Users can have stub implementations if they do not use those functionalities.

Mappings:
Namespace Name
named net/minecraft/recipe/Recipe
intermediary net/minecraft/class_1860
official dcd
  • Field Details

    • CODEC

      static final com.mojang.serialization.Codec<Recipe<?>> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/recipe/Recipe;CODEC:Lcom/mojang/serialization/Codec;
      intermediary field_47319 Lnet/minecraft/class_1860;field_47319:Lcom/mojang/serialization/Codec;
      official a Ldcd;a:Lcom/mojang/serialization/Codec;
    • PACKET_CODEC

      static final PacketCodec<RegistryByteBuf,Recipe<?>> PACKET_CODEC
      Mappings:
      Namespace Name Mixin selector
      named PACKET_CODEC Lnet/minecraft/recipe/Recipe;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
      intermediary field_48356 Lnet/minecraft/class_1860;field_48356:Lnet/minecraft/class_9139;
      official b Ldcd;b:Lzt;
  • Method Details

    • matches

      boolean matches(T input, World world)
      Returns whether this recipe matches the contents inside the inventory in the given world.

      The world currently is only used by the map cloning recipe to prevent duplication of explorer maps.

      Parameters:
      world - the input world
      Returns:
      whether this recipe matches the contents inside the inventory in the given world
      Mappings:
      Namespace Name Mixin selector
      named matches Lnet/minecraft/recipe/Recipe;matches(Lnet/minecraft/recipe/input/RecipeInput;Lnet/minecraft/world/World;)Z
      intermediary method_8115 Lnet/minecraft/class_1860;method_8115(Lnet/minecraft/class_9695;Lnet/minecraft/class_1937;)Z
      official a Ldcd;a(Ldcj;Ldhh;)Z
    • craft

      ItemStack craft(T input, RegistryWrapper.WrapperLookup registries)
      Crafts this recipe.

      This method does not perform side effects on the inventory.

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

      Returns:
      the resulting item stack
      Mappings:
      Namespace Name Mixin selector
      named craft Lnet/minecraft/recipe/Recipe;craft(Lnet/minecraft/recipe/input/RecipeInput;Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Lnet/minecraft/item/ItemStack;
      intermediary method_8116 Lnet/minecraft/class_1860;method_8116(Lnet/minecraft/class_9695;Lnet/minecraft/class_7225$class_7874;)Lnet/minecraft/class_1799;
      official a Ldcd;a(Ldcj;Ljs$a;)Lcxo;
    • isIgnoredInRecipeBook

      default boolean isIgnoredInRecipeBook()
      Returns whether this recipe is ignored by the recipe book. If a recipe is ignored by the recipe book, it will be never displayed. In addition, it won't be restricted by the doLimitedCrafting game rule.
      Returns:
      whether this recipe is ignored by the recipe book
      Mappings:
      Namespace Name Mixin selector
      named isIgnoredInRecipeBook Lnet/minecraft/recipe/Recipe;isIgnoredInRecipeBook()Z
      intermediary method_8118 Lnet/minecraft/class_1860;method_8118()Z
      official aq_ Ldcd;aq_()Z
    • showNotification

      default boolean showNotification()
      Mappings:
      Namespace Name Mixin selector
      named showNotification Lnet/minecraft/recipe/Recipe;showNotification()Z
      intermediary method_49188 Lnet/minecraft/class_1860;method_49188()Z
      official i Ldcd;i()Z
    • getGroup

      default String getGroup()
      Returns a group this recipe belongs in, or an empty string. This is only used by the recipe book.

      The group string is arbitrary, and is not rendered anywhere; in the recipe book, recipes with the same group will belong to the same cell in the grid of recipes. If the string is empty, this recipe will belong to its own cell.

      Returns:
      a group this recipe belongs in, or an empty string
      Mappings:
      Namespace Name Mixin selector
      named getGroup Lnet/minecraft/recipe/Recipe;getGroup()Ljava/lang/String;
      intermediary method_8112 Lnet/minecraft/class_1860;method_8112()Ljava/lang/String;
      official j Ldcd;j()Ljava/lang/String;
    • getSerializer

      RecipeSerializer<? extends Recipe<T>> getSerializer()
      Returns the serializer associated with this recipe.
      Returns:
      the serializer associated with this recipe
      Mappings:
      Namespace Name Mixin selector
      named getSerializer Lnet/minecraft/recipe/Recipe;getSerializer()Lnet/minecraft/recipe/RecipeSerializer;
      intermediary method_8119 Lnet/minecraft/class_1860;method_8119()Lnet/minecraft/class_1865;
      official a Ldcd;a()Ldcn;
    • getType

      RecipeType<? extends Recipe<T>> getType()
      Returns the type of this recipe.

      The type in the recipe JSON format is the serializer instead.

      Returns:
      the type of this recipe
      Mappings:
      Namespace Name Mixin selector
      named getType Lnet/minecraft/recipe/Recipe;getType()Lnet/minecraft/recipe/RecipeType;
      intermediary method_17716 Lnet/minecraft/class_1860;method_17716()Lnet/minecraft/class_3956;
      official b Ldcd;b()Ldco;
    • getIngredientPlacement

      IngredientPlacement getIngredientPlacement()
      Mappings:
      Namespace Name Mixin selector
      named getIngredientPlacement Lnet/minecraft/recipe/Recipe;getIngredientPlacement()Lnet/minecraft/recipe/IngredientPlacement;
      intermediary method_61671 Lnet/minecraft/class_1860;method_61671()Lnet/minecraft/class_9887;
      official ap_ Ldcd;ap_()Ldcc;
    • getDisplays

      default List<RecipeDisplay> getDisplays()
      invalid reference
      list of recipe displays corresponding to the recipe

      Recipe displays are sent to the client and displayed in the recipe book. One recipe can have multiple displays.

      Mappings:
      Namespace Name Mixin selector
      named getDisplays Lnet/minecraft/recipe/Recipe;getDisplays()Ljava/util/List;
      intermediary method_64664 Lnet/minecraft/class_1860;method_64664()Ljava/util/List;
      official g Ldcd;g()Ljava/util/List;
    • getRecipeBookCategory

      RecipeBookCategory getRecipeBookCategory()
      Mappings:
      Namespace Name Mixin selector
      named getRecipeBookCategory Lnet/minecraft/recipe/Recipe;getRecipeBookCategory()Lnet/minecraft/recipe/book/RecipeBookCategory;
      intermediary method_64668 Lnet/minecraft/class_1860;method_64668()Lnet/minecraft/class_10355;
      official h Ldcd;h()Ldcg;