public class PotionEffect
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
amplifier
The amplifier of the potion effect
|
private int |
duration
The duration of the potion effect
|
private boolean |
isAmbient
Whether the potion effect came from a beacon
|
private boolean |
isPotionDurationMax
True if potion effect duration is at maximum, false otherwise.
|
private boolean |
isSplashPotion
Whether the potion is a splash potion
|
private static org.apache.logging.log4j.Logger |
LOGGER |
private int |
potionID
ID value of the potion this effect matches.
|
private boolean |
showParticles |
Constructor and Description |
---|
PotionEffect(int id,
int effectDuration) |
PotionEffect(int id,
int effectDuration,
int effectAmplifier) |
PotionEffect(int id,
int effectDuration,
int effectAmplifier,
boolean ambient,
boolean showParticles) |
PotionEffect(PotionEffect other) |
Modifier and Type | Method and Description |
---|---|
void |
combine(PotionEffect other)
merges the input PotionEffect into this one if this.amplifier <= tomerge.amplifier.
|
private int |
deincrementDuration() |
boolean |
equals(java.lang.Object p_equals_1_) |
int |
getAmplifier() |
int |
getDuration() |
java.lang.String |
getEffectName() |
boolean |
getIsAmbient()
Gets whether this potion effect originated from a beacon
|
boolean |
getIsPotionDurationMax() |
boolean |
getIsShowParticles() |
int |
getPotionID()
Retrieve the ID of the potion this effect matches.
|
int |
hashCode() |
boolean |
onUpdate(EntityLivingBase entityIn) |
void |
performEffect(EntityLivingBase entityIn) |
static PotionEffect |
readCustomPotionEffectFromNBT(NBTTagCompound nbt)
Read a custom potion effect from a potion item's NBT data.
|
void |
setPotionDurationMax(boolean maxDuration)
Toggle the isPotionDurationMax field.
|
void |
setSplashPotion(boolean splashPotion)
Set whether this potion is a splash potion.
|
java.lang.String |
toString() |
NBTTagCompound |
writeCustomPotionEffectToNBT(NBTTagCompound nbt)
Write a custom potion effect to a potion item's NBT data.
|
private static final org.apache.logging.log4j.Logger LOGGER
private int potionID
private int duration
private int amplifier
private boolean isSplashPotion
private boolean isAmbient
private boolean isPotionDurationMax
private boolean showParticles
public PotionEffect(int id, int effectDuration)
public PotionEffect(int id, int effectDuration, int effectAmplifier)
public PotionEffect(int id, int effectDuration, int effectAmplifier, boolean ambient, boolean showParticles)
public PotionEffect(PotionEffect other)
public void combine(PotionEffect other)
public int getPotionID()
public int getDuration()
public int getAmplifier()
public void setSplashPotion(boolean splashPotion)
public boolean getIsAmbient()
public boolean getIsShowParticles()
public boolean onUpdate(EntityLivingBase entityIn)
private int deincrementDuration()
public void performEffect(EntityLivingBase entityIn)
public java.lang.String getEffectName()
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object p_equals_1_)
equals
in class java.lang.Object
public NBTTagCompound writeCustomPotionEffectToNBT(NBTTagCompound nbt)
public static PotionEffect readCustomPotionEffectFromNBT(NBTTagCompound nbt)
public void setPotionDurationMax(boolean maxDuration)
public boolean getIsPotionDurationMax()