Package org.bukkit.potion
Class Potion
java.lang.Object
org.bukkit.potion.Potion
@Deprecated public class Potion extends Object
Deprecated.
Potion Adapter for pre-1.9 data values
 see @PotionMeta for 1.9+
- 
Constructor SummaryConstructors Constructor Description Potion(PotionType type)Deprecated.Construct a new potion of the given type.Potion(PotionType type, int level)Deprecated.Create a new potion of the given type and level.Potion(PotionType type, int level, boolean splash)Deprecated.In favour of usingPotion(PotionType)withsplash().Potion(PotionType type, int level, boolean splash, boolean extended)Deprecated.
- 
Method SummaryModifier and Type Method Description voidapply(LivingEntity to)Deprecated.Applies the effects that would be applied by this potion to the givenLivingEntity.voidapply(ItemStack to)Deprecated.Applies the effects of this potion to the givenItemStack.booleanequals(Object obj)Deprecated.Potionextend()Deprecated.Chain this to the constructor to extend the potion's duration.static PotionfromDamage(int damage)Deprecated.Gets the potion from its damage value.static PotionfromItemStack(ItemStack item)Deprecated.static PotionBrewergetBrewer()Deprecated.Returns an instance ofPotionBrewer.Collection<PotionEffect>getEffects()Deprecated.intgetLevel()Deprecated.Returns the level of this potion.intgetNameId()Deprecated.Non-functionalPotionTypegetType()Deprecated.Returns thePotionTypeof this potion.booleanhasExtendedDuration()Deprecated.Returns whether this potion has an extended duration.inthashCode()Deprecated.booleanisSplash()Deprecated.Returns whether this potion is a splash potion.voidsetHasExtendedDuration(boolean isExtended)Deprecated.Set whether this potion has extended duration.voidsetLevel(int level)Deprecated.Sets the level of this potion.static voidsetPotionBrewer(PotionBrewer other)Deprecated.Sets the current instance ofPotionBrewer.voidsetSplash(boolean isSplash)Deprecated.Sets whether this potion is a splash potion.voidsetType(PotionType type)Deprecated.Sets thePotionTypeof this potion.Potionsplash()Deprecated.Chain this to the constructor to make the potion a splash potion.shorttoDamageValue()Deprecated.Non-functionalItemStacktoItemStack(int amount)Deprecated.Converts this potion to anItemStackwith the specified amount and a correct damage value.
- 
Constructor Details- 
PotionDeprecated.Construct a new potion of the given type. Unless the type isPotionType.WATER, it will be level one, without extended duration. Don't use this constructor to create a no-effect potion other than water bottle.- Parameters:
- type- The potion type
 
- 
PotionDeprecated.Create a new potion of the given type and level.- Parameters:
- type- The type of potion.
- level- The potion's level.
 
- 
PotionDeprecated.In favour of usingPotion(PotionType)withsplash().Create a new potion of the given type and level.- Parameters:
- type- The type of potion.
- level- The potion's level.
- splash- Whether it is a splash potion.
 
- 
PotionDeprecated.Create a new potion of the given type and level.- Parameters:
- type- The type of potion.
- level- The potion's level.
- splash- Whether it is a splash potion.
- extended- Whether it has an extended duration.
 
 
- 
- 
Method Details- 
splashDeprecated.Chain this to the constructor to make the potion a splash potion.- Returns:
- The potion.
 
- 
extendDeprecated.Chain this to the constructor to extend the potion's duration.- Returns:
- The potion.
 
- 
applyDeprecated.Applies the effects of this potion to the givenItemStack. The ItemStack must be a potion.- Parameters:
- to- The itemstack to apply to
 
- 
applyDeprecated.Applies the effects that would be applied by this potion to the givenLivingEntity.- Parameters:
- to- The entity to apply the effects to
- See Also:
- LivingEntity.addPotionEffects(Collection)
 
- 
equalsDeprecated.
- 
getEffectsDeprecated.- Returns:
- The effects that this potion applies
- See Also:
- PotionBrewer.getEffectsFromDamage(int),- toDamageValue()
 
- 
getLevelpublic int getLevel()Deprecated.Returns the level of this potion.- Returns:
- The level of this potion
 
- 
getTypeDeprecated.Returns thePotionTypeof this potion.- Returns:
- The type of this potion
 
- 
hasExtendedDurationpublic boolean hasExtendedDuration()Deprecated.Returns whether this potion has an extended duration.- Returns:
- Whether this potion has extended duration
 
- 
hashCodepublic int hashCode()Deprecated.
- 
isSplashpublic boolean isSplash()Deprecated.Returns whether this potion is a splash potion.- Returns:
- Whether this is a splash potion
 
- 
setHasExtendedDurationpublic void setHasExtendedDuration(boolean isExtended)Deprecated.Set whether this potion has extended duration. This will cause the potion to have roughly 8/3 more duration than a regular potion.- Parameters:
- isExtended- Whether the potion should have extended duration
 
- 
setSplashpublic void setSplash(boolean isSplash)Deprecated.Sets whether this potion is a splash potion. Splash potions can be thrown for a radius effect.- Parameters:
- isSplash- Whether this is a splash potion
 
- 
setTypeDeprecated.Sets thePotionTypeof this potion.- Parameters:
- type- The new type of this potion
 
- 
setLevelpublic void setLevel(int level)Deprecated.Sets the level of this potion.- Parameters:
- level- The new level of this potion
 
- 
toDamageValueDeprecated.Non-functionalConverts this potion to a valid potion damage short, usable for potion item stacks.- Returns:
- The damage value of this potion
 
- 
toItemStackDeprecated.Converts this potion to anItemStackwith the specified amount and a correct damage value.- Parameters:
- amount- The amount of the ItemStack
- Returns:
- The created ItemStack
 
- 
fromDamageDeprecated.Gets the potion from its damage value.- Parameters:
- damage- the damage value
- Returns:
- the produced potion
 
- 
fromItemStackDeprecated.
- 
getBrewerDeprecated.Returns an instance ofPotionBrewer.- Returns:
- An instance of PotionBrewer
 
- 
setPotionBrewerDeprecated.Sets the current instance ofPotionBrewer. Generally not to be used from within a plugin.- Parameters:
- other- The new PotionBrewer
 
- 
getNameIdDeprecated.Non-functionalGets the potion from its name id.- Returns:
- the name id
 
 
-