Interface Ingredient.Builder

All Superinterfaces:
AbstractBuilder<Ingredient>, Builder<Ingredient,Ingredient.Builder>, ResettableBuilder<Ingredient,Ingredient.Builder>
Enclosing interface:
Ingredient

public static interface Ingredient.Builder extends Builder<Ingredient,Ingredient.Builder>
Builder for Ingredients.
  • Method Details

    • with

      Ingredient.Builder with(ItemType... types)
      Sets one or more ItemTypes for matching the ingredient.
      Parameters:
      types - The items
      Returns:
      This Builder, for chaining
    • with

      Ingredient.Builder with(Supplier<? extends ItemType>... types)
      Sets one or more ItemTypes for matching the ingredient.
      Parameters:
      types - The items
      Returns:
      This Builder, for chaining
    • with

      Sets one or more ItemStackLike for matching the ingredient.
      Parameters:
      types - The items
      Returns:
      This Builder, for chaining
    • with

      Ingredient.Builder with(ResourceKey resourceKey, Predicate<? super ItemStackLike> predicate, ItemStackLike... exemplaryTypes)
      Sets a Predicate for matching the ingredient.

      Exemplary types are used for the vanilla recipe book.

      Note: Predicate ingredients may not be fully supported for all recipe types

      Parameters:
      predicate - The predicate
      exemplaryTypes - The items
      Returns:
      This Builder, for chaining
    • with

      Sets the item tag for matching the ingredient.
      Parameters:
      itemTag - The item tag
      Returns:
      This Builder, for chaining
    • build

      Ingredient build()
      Builds the Ingredient with the specified items and or predicates.
      Specified by:
      build in interface AbstractBuilder<Ingredient>
      Returns:
      The new Ingredient