public class StatusEffectInstance extends Object implements Comparable<StatusEffectInstance>
Modifier and Type | Field and Description |
---|---|
private boolean |
ambient |
private int |
amplifier |
private int |
duration |
private StatusEffectInstance |
hiddenEffect
The effect hidden when upgrading effects.
|
private static Logger |
LOGGER |
private boolean |
permanent |
private boolean |
showIcon |
private boolean |
showParticles |
private boolean |
splash |
private StatusEffect |
type |
Constructor and Description |
---|
StatusEffectInstance(StatusEffect statusEffect) |
StatusEffectInstance(StatusEffectInstance statusEffectInstance) |
StatusEffectInstance(StatusEffect type,
int duration) |
StatusEffectInstance(StatusEffect type,
int duration,
int amplifier) |
StatusEffectInstance(StatusEffect type,
int duration,
int amplifier,
boolean ambient,
boolean visible) |
StatusEffectInstance(StatusEffect type,
int duration,
int amplifier,
boolean ambient,
boolean showParticles,
boolean showIcon) |
StatusEffectInstance(StatusEffect type,
int duration,
int amplifier,
boolean ambient,
boolean showParticles,
boolean showIcon,
StatusEffectInstance hiddenEffect) |
Modifier and Type | Method and Description |
---|---|
void |
applyUpdateEffect(LivingEntity entity) |
int |
compareTo(StatusEffectInstance statusEffectInstance) |
(package private) void |
copyFrom(StatusEffectInstance that) |
boolean |
equals(Object o) |
static StatusEffectInstance |
fromTag(CompoundTag tag) |
private static StatusEffectInstance |
fromTag(StatusEffect type,
CompoundTag tag) |
int |
getAmplifier() |
int |
getDuration() |
StatusEffect |
getEffectType() |
String |
getTranslationKey() |
int |
hashCode() |
boolean |
isAmbient() |
boolean |
isPermanent() |
void |
setPermanent(boolean permanent) |
boolean |
shouldShowIcon() |
boolean |
shouldShowParticles() |
String |
toString() |
CompoundTag |
toTag(CompoundTag tag) |
private void |
typelessToTag(CompoundTag tag) |
boolean |
update(LivingEntity entity,
Runnable overwriteCallback) |
private int |
updateDuration() |
boolean |
upgrade(StatusEffectInstance that) |
private static final Logger LOGGER
private final StatusEffect type
private int duration
private int amplifier
private boolean splash
private boolean ambient
@Environment(value=CLIENT) private boolean permanent
private boolean showParticles
private boolean showIcon
@Nullable private StatusEffectInstance hiddenEffect
This exists so that long-duration low-amplifier effects reappears after short-duration high-amplifier effects run out.
public StatusEffectInstance(StatusEffect statusEffect)
public StatusEffectInstance(StatusEffect type, int duration)
public StatusEffectInstance(StatusEffect type, int duration, int amplifier)
public StatusEffectInstance(StatusEffect type, int duration, int amplifier, boolean ambient, boolean visible)
public StatusEffectInstance(StatusEffect type, int duration, int amplifier, boolean ambient, boolean showParticles, boolean showIcon)
public StatusEffectInstance(StatusEffect type, int duration, int amplifier, boolean ambient, boolean showParticles, boolean showIcon, @Nullable StatusEffectInstance hiddenEffect)
public StatusEffectInstance(StatusEffectInstance statusEffectInstance)
void copyFrom(StatusEffectInstance that)
public boolean upgrade(StatusEffectInstance that)
public StatusEffect getEffectType()
public int getDuration()
public int getAmplifier()
public boolean isAmbient()
public boolean shouldShowParticles()
public boolean shouldShowIcon()
public boolean update(LivingEntity entity, Runnable overwriteCallback)
private int updateDuration()
public void applyUpdateEffect(LivingEntity entity)
public String getTranslationKey()
public CompoundTag toTag(CompoundTag tag)
private void typelessToTag(CompoundTag tag)
public static StatusEffectInstance fromTag(CompoundTag tag)
private static StatusEffectInstance fromTag(StatusEffect type, CompoundTag tag)
@Environment(value=CLIENT) public void setPermanent(boolean permanent)
@Environment(value=CLIENT) public boolean isPermanent()
public int compareTo(StatusEffectInstance statusEffectInstance)
compareTo
in interface Comparable<StatusEffectInstance>