Package net.minecraft.recipe
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 Summary
Modifier and Type Method Description ItemStackcraft(C inventory)Crafts this recipe.default ItemStackcreateIcon()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.booleanfits(int width, int height)Determines whether this recipe's pattern will fit into the available crafting area.default StringgetGroup()Optional group this recipe belongs in.IdentifiergetId()default DefaultedList<Ingredient>getIngredients()The ingredients accepted as inputs for this recipe.ItemStackgetOutput()default DefaultedList<ItemStack>getRemainder(C inventory)Returns the remaining stacks to be left in the crafting grid after crafting is complete.RecipeSerializer<?>getSerializer()RecipeType<?>getType()default booleanisIgnoredInRecipeBook()booleanmatches(C inventory, World world)Determines whether this recipe matches the contents currently placed inside the available crafting grid.
-
Method Details
-
matches
Determines whether this recipe matches the contents currently placed inside the available crafting grid. -
craft
Crafts this recipe.This method may perform side effects on the
inventoryargument.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
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
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
Optional group this recipe belongs in. Used to group recipes into different categories by the recipe book. -
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 withgetGroup(). -
getId
Identifier getId() -
getSerializer
RecipeSerializer<?> getSerializer() -
getType
RecipeType<?> getType()
-