Package net.minecraft.world.effect
Class MobEffectInstance
java.lang.Object
net.minecraft.world.effect.MobEffectInstance
- All Implemented Interfaces:
Comparable<MobEffectInstance>
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private int
private final Set<EffectCure>
private int
private final MobEffect
private final Optional<MobEffectInstance.FactorData>
private MobEffectInstance
static final int
private static final org.slf4j.Logger
private boolean
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private boolean
-
Constructor Summary
ConstructorDescriptionMobEffectInstance
(MobEffect p_19513_) MobEffectInstance
(MobEffectInstance p_19543_) MobEffectInstance
(MobEffect p_19515_, int p_19516_) MobEffectInstance
(MobEffect p_19518_, int p_19519_, int p_19520_) MobEffectInstance
(MobEffect p_19522_, int p_19523_, int p_19524_, boolean p_19525_, boolean p_19526_) MobEffectInstance
(MobEffect p_19528_, int p_19529_, int p_19530_, boolean p_19531_, boolean p_19532_, boolean p_19533_) MobEffectInstance
(MobEffect p_216887_, int p_216888_, int p_216889_, boolean p_216890_, boolean p_216891_, boolean p_216892_, MobEffectInstance p_216893_, Optional<MobEffectInstance.FactorData> p_216894_) -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(MobEffectInstance p_19566_) private String
boolean
endsWithin
(int p_268088_) boolean
int
getCures()
int
int
hashCode()
private boolean
boolean
boolean
private boolean
isShorterDurationThan
(MobEffectInstance p_268133_) boolean
static MobEffectInstance
load
(CompoundTag p_19561_) private static MobEffectInstance
loadSpecifiedEffect
(MobEffect p_19546_, CompoundTag p_19547_) int
mapDuration
(it.unimi.dsi.fastutil.ints.Int2IntFunction p_268089_) void
onEffectStarted
(LivingEntity p_295220_) private MobEffectInstance
readCures
(CompoundTag tag) save
(CompoundTag p_19556_) (package private) void
setDetailsFrom
(MobEffectInstance p_19549_) boolean
showIcon()
boolean
tick
(LivingEntity p_19553_, Runnable p_19554_) private int
toString()
boolean
update
(MobEffectInstance p_19559_) private void
writeCures
(CompoundTag tag) private void
writeDetailsTo
(CompoundTag p_19568_)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
INFINITE_DURATION
public static final int INFINITE_DURATION- See Also:
-
TAG_ID
- See Also:
-
TAG_AMBIENT
- See Also:
-
TAG_HIDDEN_EFFECT
- See Also:
-
TAG_AMPLIFIER
- See Also:
-
TAG_DURATION
- See Also:
-
TAG_SHOW_PARTICLES
- See Also:
-
TAG_SHOW_ICON
- See Also:
-
TAG_FACTOR_CALCULATION_DATA
- See Also:
-
effect
-
duration
private int duration -
amplifier
private int amplifier -
ambient
private boolean ambient -
visible
private boolean visible -
showIcon
private boolean showIcon -
factorData
-
cures
-
-
Constructor Details
-
MobEffectInstance
-
MobEffectInstance
-
MobEffectInstance
-
MobEffectInstance
public MobEffectInstance(MobEffect p_19522_, int p_19523_, int p_19524_, boolean p_19525_, boolean p_19526_) -
MobEffectInstance
public MobEffectInstance(MobEffect p_19528_, int p_19529_, int p_19530_, boolean p_19531_, boolean p_19532_, boolean p_19533_) -
MobEffectInstance
public MobEffectInstance(MobEffect p_216887_, int p_216888_, int p_216889_, boolean p_216890_, boolean p_216891_, boolean p_216892_, @Nullable MobEffectInstance p_216893_, Optional<MobEffectInstance.FactorData> p_216894_) -
MobEffectInstance
-
-
Method Details
-
getFactorData
-
setDetailsFrom
-
update
-
isShorterDurationThan
-
isInfiniteDuration
public boolean isInfiniteDuration() -
endsWithin
public boolean endsWithin(int p_268088_) -
mapDuration
public int mapDuration(it.unimi.dsi.fastutil.ints.Int2IntFunction p_268089_) -
getEffect
-
getDuration
public int getDuration() -
getAmplifier
public int getAmplifier() -
isAmbient
public boolean isAmbient() -
isVisible
public boolean isVisible() -
showIcon
public boolean showIcon() -
tick
-
hasRemainingDuration
private boolean hasRemainingDuration() -
tickDownDuration
private int tickDownDuration() -
onEffectStarted
-
getDescriptionId
-
toString
-
describeDuration
-
equals
-
hashCode
public int hashCode() -
save
-
writeDetailsTo
-
load
-
loadSpecifiedEffect
-
compareTo
- Specified by:
compareTo
in interfaceComparable<MobEffectInstance>
-
getCures
- Returns:
- the
EffectCure
s which can cure theMobEffect
held by thisMobEffectInstance
-
readCures
-
writeCures
-