Package net.minecraft.entity.effect
Class StatusEffectInstance
java.lang.Object
net.minecraft.entity.effect.StatusEffectInstance
- All Implemented Interfaces:
Comparable<StatusEffectInstance>
public class StatusEffectInstance extends Object implements Comparable<StatusEffectInstance>
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor 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)
-
Method Summary
Modifier and Type Method Description void
applyUpdateEffect(LivingEntity entity)
int
compareTo(StatusEffectInstance statusEffectInstance)
(package private) void
copyFrom(StatusEffectInstance that)
boolean
equals(Object o)
private static StatusEffectInstance
fromTag(StatusEffect type, CompoundTag tag)
static StatusEffectInstance
fromTag(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)
-
Field Details
-
LOGGER
-
type
-
duration
private int duration -
amplifier
private int amplifier -
splash
private boolean splash -
ambient
private boolean ambient -
permanent
@Environment(CLIENT) private boolean permanent -
showParticles
private boolean showParticles -
showIcon
private boolean showIcon
-
-
Constructor Details
-
StatusEffectInstance
-
StatusEffectInstance
-
StatusEffectInstance
-
StatusEffectInstance
public StatusEffectInstance(StatusEffect type, int duration, int amplifier, boolean ambient, boolean visible) -
StatusEffectInstance
public StatusEffectInstance(StatusEffect type, int duration, int amplifier, boolean ambient, boolean showParticles, boolean showIcon) -
StatusEffectInstance
public StatusEffectInstance(StatusEffect type, int duration, int amplifier, boolean ambient, boolean showParticles, boolean showIcon, @Nullable StatusEffectInstance hiddenEffect) -
StatusEffectInstance
-
-
Method Details
-
copyFrom
-
upgrade
-
getEffectType
-
getDuration
public int getDuration() -
getAmplifier
public int getAmplifier() -
isAmbient
public boolean isAmbient() -
shouldShowParticles
public boolean shouldShowParticles() -
shouldShowIcon
public boolean shouldShowIcon() -
update
-
updateDuration
private int updateDuration() -
applyUpdateEffect
-
getTranslationKey
-
toString
-
equals
-
hashCode
public int hashCode() -
toTag
-
typelessToTag
-
fromTag
-
fromTag
-
setPermanent
@Environment(CLIENT) public void setPermanent(boolean permanent) -
isPermanent
@Environment(CLIENT) public boolean isPermanent() -
compareTo
- Specified by:
compareTo
in interfaceComparable<StatusEffectInstance>
-