Package org.bukkit.potion
Class Potion
java.lang.Object
org.bukkit.potion.Potion
Deprecated.
Potion Adapter for pre-1.9 data values
see @PotionMeta for 1.9+
-
Constructor Summary
ConstructorDescriptionPotion(@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.Potion(@NotNull PotionType type, int level, boolean splash, boolean extended)
Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply(@NotNull LivingEntity to)
Deprecated.Applies the effects that would be applied by this potion to the givenLivingEntity
.void
Deprecated.Applies the effects of this potion to the givenItemStack
.boolean
Deprecated.extend()
Deprecated.Chain this to the constructor to extend the potion's duration.fromDamage(int damage)
Deprecated.Gets the potion from its damage value.fromItemStack(@NotNull ItemStack item)
Deprecated.static @NotNull PotionBrewer
Deprecated.Returns an instance ofPotionBrewer
.Deprecated.int
getLevel()
Deprecated.Returns the level of this potion.int
Deprecated.Non-functionalgetType()
Deprecated.Returns thePotionType
of this potion.boolean
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 ofPotionBrewer
.void
setSplash(boolean isSplash)
Deprecated.Sets whether this potion is a splash potion.void
setType(@NotNull PotionType type)
Deprecated.Sets thePotionType
of this potion.splash()
Deprecated.Chain this to the constructor to make the potion a splash potion.short
Deprecated.Non-functionaltoItemStack(int amount)
Deprecated.Converts this potion to anItemStack
with the specified amount and a correct damage value.
-
Constructor Details
-
Potion
Deprecated.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
-
Potion
Deprecated.Create a new potion of the given type and level.- Parameters:
type
- The type of potion.level
- The potion's level.
-
Potion
Deprecated.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.
-
Potion
@Deprecated public Potion(@NotNull @NotNull PotionType type, int level, boolean splash, boolean extended)Deprecated.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
-
splash
Deprecated.Chain this to the constructor to make the potion a splash potion.- Returns:
- The potion.
-
extend
Deprecated.Chain this to the constructor to extend the potion's duration.- Returns:
- The potion.
-
apply
Deprecated.Applies the effects of this potion to the givenItemStack
. The ItemStack must be a potion.- Parameters:
to
- The itemstack to apply to
-
apply
Deprecated.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)
-
equals
Deprecated. -
getEffects
Deprecated.- Returns:
- The effects that this potion applies
- See Also:
PotionBrewer.getEffectsFromDamage(int)
,toDamageValue()
-
getLevel
public int getLevel()Deprecated.Returns the level of this potion.- Returns:
- The level of this potion
-
getType
Deprecated.Returns thePotionType
of this potion.- Returns:
- The type of this potion
-
hasExtendedDuration
public boolean hasExtendedDuration()Deprecated.Returns whether this potion has an extended duration.- Returns:
- Whether this potion has extended duration
-
hashCode
public int hashCode()Deprecated. -
isSplash
public boolean isSplash()Deprecated.Returns whether this potion is a splash potion.- Returns:
- Whether this is a splash potion
-
setHasExtendedDuration
public 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
-
setSplash
public 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
-
setType
Deprecated.Sets thePotionType
of this potion.- Parameters:
type
- The new type of this potion
-
setLevel
public void setLevel(int level)Deprecated.Sets the level of this potion.- Parameters:
level
- The new level of this potion
-
toDamageValue
Deprecated.Non-functionalConverts this potion to a valid potion damage short, usable for potion item stacks.- Returns:
- The damage value of this potion
-
toItemStack
Deprecated.Converts this potion to anItemStack
with the specified amount and a correct damage value.- Parameters:
amount
- The amount of the ItemStack- Returns:
- The created ItemStack
-
fromDamage
Deprecated.Gets the potion from its damage value.- Parameters:
damage
- the damage value- Returns:
- the produced potion
-
fromItemStack
Deprecated. -
getBrewer
Deprecated.Returns an instance ofPotionBrewer
.- Returns:
- An instance of PotionBrewer
-
setPotionBrewer
Deprecated.Sets the current instance ofPotionBrewer
. Generally not to be used from within a plugin.- Parameters:
other
- The new PotionBrewer
-
getNameId
Deprecated.Non-functionalGets the potion from its name id.- Returns:
- the name id
-
Potion(PotionType)
withsplash()
.