|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bukkit.potion.PotionEffect
public class PotionEffect
Represents a potion effect, that can be added to a LivingEntity
. A
potion effect has a duration that it will last for, an amplifier that will
enhance its effects, and a PotionEffectType
, that represents its
effect on an entity.
Constructor Summary | |
---|---|
PotionEffect(Map<String,Object> map)
Constructor for deserialization. |
|
PotionEffect(PotionEffectType type,
int duration,
int amplifier)
Creates a potion effect. |
|
PotionEffect(PotionEffectType type,
int duration,
int amplifier,
boolean ambient)
Creates a potion effect. |
Method Summary | |
---|---|
boolean |
apply(LivingEntity entity)
Attempts to add the effect represented by this object to the given LivingEntity . |
boolean |
equals(Object obj)
|
int |
getAmplifier()
Returns the amplifier of this effect. |
int |
getDuration()
Returns the duration (in ticks) that this effect will run for when applied to a LivingEntity . |
PotionEffectType |
getType()
Returns the PotionEffectType of this effect. |
int |
hashCode()
|
boolean |
isAmbient()
Makes potion effect produce more, translucent, particles. |
Map<String,Object> |
serialize()
Creates a Map representation of this class. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PotionEffect(PotionEffectType type, int duration, int amplifier, boolean ambient)
type
- effect typeduration
- measured in ticks, see getDuration()
amplifier
- the amplifier, see getAmplifier()
ambient
- the ambient status, see isAmbient()
public PotionEffect(PotionEffectType type, int duration, int amplifier)
type
- Effect typeduration
- measured in ticksamplifier
- the amplifier for the effectPotionEffect(PotionEffectType, int, int, boolean)
public PotionEffect(Map<String,Object> map)
map
- the map to deserialize fromMethod Detail |
---|
public Map<String,Object> serialize()
ConfigurationSerializable
This class must provide a method to restore this class, as defined in the
ConfigurationSerializable
interface javadocs.
serialize
in interface ConfigurationSerializable
public boolean apply(LivingEntity entity)
LivingEntity
.
entity
- The entity to add this effect to
LivingEntity.addPotionEffect(PotionEffect)
public boolean equals(Object obj)
equals
in class Object
public int getAmplifier()
public int getDuration()
LivingEntity
.
public PotionEffectType getType()
PotionEffectType
of this effect.
public boolean isAmbient()
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |