|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bukkit.potion.Potion
public class Potion
Represents a minecraft potion
Nested Class Summary | |
---|---|
static class |
Potion.Tier
Deprecated. |
Constructor Summary | |
---|---|
Potion(int name)
Create a potion with a specific name. |
|
Potion(PotionType type)
Construct a new potion of the given type. |
|
Potion(PotionType type,
int level)
Create a new potion of the given type and level. |
|
Potion(PotionType type,
int level,
boolean splash)
Deprecated. In favour of using Potion(PotionType) with splash() . |
|
Potion(PotionType type,
int level,
boolean splash,
boolean extended)
Deprecated. In favour of using Potion(PotionType) with extend()
and possibly splash() . |
|
Potion(PotionType type,
Potion.Tier tier)
Deprecated. In favour of Potion(PotionType, int) |
|
Potion(PotionType type,
Potion.Tier tier,
boolean splash)
Deprecated. In favour of Potion(PotionType, int, boolean) |
|
Potion(PotionType type,
Potion.Tier tier,
boolean splash,
boolean extended)
Deprecated. In favour of Potion(PotionType, int, boolean, boolean) |
Method Summary | |
---|---|
void |
apply(ItemStack to)
Applies the effects of this potion to the given ItemStack . |
void |
apply(LivingEntity to)
Applies the effects that would be applied by this potion to the given LivingEntity . |
boolean |
equals(Object obj)
|
Potion |
extend()
Chain this to the constructor to extend the potion's duration. |
static Potion |
fromDamage(int damage)
Deprecated. Magic value |
static Potion |
fromItemStack(ItemStack item)
|
static PotionBrewer |
getBrewer()
Returns an instance of PotionBrewer . |
Collection<PotionEffect> |
getEffects()
Returns a collection of PotionEffect s that this Potion
would confer upon a LivingEntity . |
int |
getLevel()
Returns the level of this potion. |
int |
getNameId()
Deprecated. Magic value |
Potion.Tier |
getTier()
Deprecated. |
PotionType |
getType()
Returns the PotionType of this potion. |
boolean |
hasExtendedDuration()
Returns whether this potion has an extended duration. |
int |
hashCode()
|
boolean |
isSplash()
Returns whether this potion is a splash potion. |
void |
setHasExtendedDuration(boolean isExtended)
Set whether this potion has extended duration. |
void |
setLevel(int level)
Sets the level of this potion. |
static void |
setPotionBrewer(PotionBrewer other)
Sets the current instance of PotionBrewer . |
void |
setSplash(boolean isSplash)
Sets whether this potion is a splash potion. |
void |
setTier(Potion.Tier tier)
Deprecated. In favour of setLevel(int) |
void |
setType(PotionType type)
Sets the PotionType of this potion. |
Potion |
splash()
Chain this to the constructor to make the potion a splash potion. |
short |
toDamageValue()
Deprecated. Magic value |
ItemStack |
toItemStack(int amount)
Converts this potion to an ItemStack with the specified amount
and a correct damage value. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Potion(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 typePotion(int)
@Deprecated public Potion(PotionType type, Potion.Tier tier)
Potion(PotionType, int)
@Deprecated public Potion(PotionType type, Potion.Tier tier, boolean splash)
Potion(PotionType, int, boolean)
@Deprecated public Potion(PotionType type, Potion.Tier tier, boolean splash, boolean extended)
Potion(PotionType, int, boolean, boolean)
public Potion(PotionType type, int level)
type
- The type of potion.level
- The potion's level.@Deprecated public Potion(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(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.public Potion(int name)
name
- The name index (0-63)Method Detail |
---|
public Potion splash()
public Potion extend()
public void apply(ItemStack to)
ItemStack
. The
itemstack must be a potion.
to
- The itemstack to apply topublic void apply(LivingEntity to)
LivingEntity
.
to
- The entity to apply the effects toLivingEntity.addPotionEffects(Collection)
public boolean equals(Object obj)
equals
in class Object
public Collection<PotionEffect> getEffects()
PotionEffect
s that this Potion
would confer upon a LivingEntity
.
PotionBrewer.getEffectsFromDamage(int)
,
toDamageValue()
public int getLevel()
@Deprecated public Potion.Tier getTier()
Potion.Tier
of this potion.
public PotionType getType()
PotionType
of this potion.
public boolean hasExtendedDuration()
public int hashCode()
hashCode
in class Object
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 potion@Deprecated public void setTier(Potion.Tier tier)
setLevel(int)
Potion.Tier
of this potion.
tier
- The new tier of this potionpublic void setType(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()
public ItemStack toItemStack(int amount)
ItemStack
with the specified amount
and a correct damage value.
amount
- The amount of the ItemStack
@Deprecated public static Potion fromDamage(int damage)
public static Potion fromItemStack(ItemStack item)
public static PotionBrewer getBrewer()
PotionBrewer
.
public static void setPotionBrewer(PotionBrewer other)
PotionBrewer
. Generally not to be
used from within a plugin.
other
- The new PotionBrewer@Deprecated public int getNameId()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |