Class PotionMix

java.lang.Object
io.papermc.paper.potion.PotionMix
All Implemented Interfaces:
Keyed, Keyed

@NullMarked public final class PotionMix extends Object implements Keyed
Represents a potion mix made in a Brewing Stand.
  • Constructor Details Link icon

    • PotionMix Link icon

      public PotionMix(NamespacedKey key, ItemStack result, RecipeChoice input, RecipeChoice ingredient)
      Creates a new potion mix. Add it to the server with PotionBrewer.addPotionMix(PotionMix).
      Parameters:
      key - a unique key for the mix
      result - the resulting itemstack that will appear in the 3 bottom slots
      input - the input placed into the bottom 3 slots
      ingredient - the ingredient placed into the top slot
  • Method Details Link icon

    • createPredicateChoice Link icon

      @Contract(value="_ -> new", pure=true) public static RecipeChoice createPredicateChoice(Predicate<? super ItemStack> stackPredicate)
      Create a RecipeChoice based on a Predicate. These RecipeChoices are only valid for PotionMix, not anywhere else RecipeChoices may be used.
      Parameters:
      stackPredicate - a predicate for an itemstack.
      Returns:
      a new RecipeChoice
    • getKey Link icon

      public NamespacedKey getKey()
      Description copied from interface: Keyed
      Return the namespaced identifier for this object.
      Specified by:
      getKey in interface Keyed
      Returns:
      this object's key
    • getResult Link icon

      public ItemStack getResult()
      Gets the resulting itemstack after the brew has finished.
      Returns:
      the result itemstack
    • getInput Link icon

      public RecipeChoice getInput()
      Gets the input for the bottom 3 slots in the brewing stand.
      Returns:
      the bottom 3 slot ingredients
    • getIngredient Link icon

      public RecipeChoice getIngredient()
      Gets the ingredient in the top slot of the brewing stand.
      Returns:
      the top slot input
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object
    • equals Link icon

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object