@Deprecated public class Potion extends Object
| Constructor | Description | 
|---|---|
| Potion(@NotNull PotionType type) | Deprecated.  Construct a new potion of the given type. | 
| Potion(@NotNull PotionType type,
      int level) | Deprecated.  Create a new potion of the given type and level. | 
| Potion(@NotNull PotionType type,
      int level,
      boolean splash) | Deprecated. 
 In favour of using  Potion(PotionType)withsplash(). | 
| Potion(@NotNull PotionType type,
      int level,
      boolean splash,
      boolean extended) | Deprecated. 
 In favour of using  Potion(PotionType)withextend()and possiblysplash(). | 
| Modifier and Type | Method | Description | 
|---|---|---|
| void | apply(@NotNull LivingEntity to) | Deprecated.  Applies the effects that would be applied by this potion to the given
  LivingEntity. | 
| void | apply(@NotNull ItemStack to) | Deprecated.  Applies the effects of this potion to the given  ItemStack. | 
| boolean | equals(Object obj) | Deprecated.  | 
| @NotNull Potion | extend() | Deprecated.  Chain this to the constructor to extend the potion's duration. | 
| static @NotNull Potion | fromDamage(int damage) | Deprecated.  Gets the potion from its damage value. | 
| static @NotNull Potion | fromItemStack(@NotNull ItemStack item) | Deprecated.  | 
| static @NotNull PotionBrewer | getBrewer() | Deprecated.  Returns an instance of  PotionBrewer. | 
| @NotNull Collection<PotionEffect> | getEffects() | Deprecated.  | 
| int | getLevel() | Deprecated.  Returns the level of this potion. | 
| int | getNameId() | Deprecated. 
 Non-functional | 
| @NotNull PotionType | getType() | Deprecated.  Returns the  PotionTypeof this potion. | 
| boolean | hasExtendedDuration() | Deprecated.  Returns whether this potion has an extended duration. | 
| int | hashCode() | Deprecated.  | 
| boolean | isSplash() | Deprecated.  Returns whether this potion is a splash potion. | 
| void | setHasExtendedDuration(boolean isExtended) | Deprecated.  Set whether this potion has extended duration. | 
| void | setLevel(int level) | Deprecated.  Sets the level of this potion. | 
| static void | setPotionBrewer(@NotNull PotionBrewer other) | Deprecated.  Sets the current instance of  PotionBrewer. | 
| void | setSplash(boolean isSplash) | Deprecated.  Sets whether this potion is a splash potion. | 
| void | setType(@NotNull PotionType type) | Deprecated.  Sets the  PotionTypeof this potion. | 
| @NotNull Potion | splash() | Deprecated.  Chain this to the constructor to make the potion a splash potion. | 
| short | toDamageValue() | Deprecated. 
 Non-functional | 
| @NotNull ItemStack | toItemStack(int amount) | Deprecated.  Converts this potion to an  ItemStackwith the specified amount
 and a correct damage value. | 
public Potion(@NotNull
              @NotNull PotionType type)
PotionType.WATER, it will be level one, without extended duration.
 Don't use this constructor to create a no-effect potion other than
 water bottle.type - The potion typepublic Potion(@NotNull
              @NotNull PotionType type,
              int level)
type - The type of potion.level - The potion's level.@Deprecated public Potion(@NotNull @NotNull PotionType type, int level, boolean splash)
Potion(PotionType) with splash().type - The type of potion.level - The potion's level.splash - Whether it is a splash potion.@Deprecated public Potion(@NotNull @NotNull PotionType type, int level, boolean splash, boolean extended)
Potion(PotionType) with extend() and possibly splash().type - The type of potion.level - The potion's level.splash - Whether it is a splash potion.extended - Whether it has an extended duration.@NotNull public @NotNull Potion splash()
@NotNull public @NotNull Potion extend()
public void apply(@NotNull
                  @NotNull ItemStack to)
ItemStack. The
 ItemStack must be a potion.to - The itemstack to apply topublic void apply(@NotNull
                  @NotNull LivingEntity to)
LivingEntity.to - The entity to apply the effects toLivingEntity.addPotionEffects(Collection)@NotNull public @NotNull Collection<PotionEffect> getEffects()
PotionBrewer.getEffectsFromDamage(int), 
toDamageValue()public int getLevel()
@NotNull public @NotNull PotionType getType()
PotionType of this potion.public boolean hasExtendedDuration()
public boolean isSplash()
public void setHasExtendedDuration(boolean isExtended)
isExtended - Whether the potion should have extended durationpublic void setSplash(boolean isSplash)
isSplash - Whether this is a splash potionpublic void setType(@NotNull
                    @NotNull PotionType type)
PotionType of this potion.type - The new type of this potionpublic void setLevel(int level)
level - The new level of this potion@Deprecated public short toDamageValue()
@NotNull public @NotNull ItemStack toItemStack(int amount)
ItemStack with the specified amount
 and a correct damage value.amount - The amount of the ItemStack@NotNull public static @NotNull Potion fromDamage(int damage)
damage - the damage value@NotNull public static @NotNull Potion fromItemStack(@NotNull @NotNull ItemStack item)
@NotNull public static @NotNull PotionBrewer getBrewer()
PotionBrewer.public static void setPotionBrewer(@NotNull
                                   @NotNull PotionBrewer other)
PotionBrewer. Generally not to be
 used from within a plugin.other - The new PotionBrewer@Deprecated public int getNameId()
Copyright © 2020. All rights reserved.