Package net.minecraft.world.effect
Class MobEffectInstance
java.lang.Object
net.minecraft.world.effect.MobEffectInstance
- All Implemented Interfaces:
Comparable<MobEffectInstance>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class(package private) static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate intprivate final MobEffectInstance.BlendStatestatic final com.mojang.serialization.Codec<MobEffectInstance> private intprivate MobEffectInstanceA hidden effect which is not shown to the player.static final intprivate static final org.slf4j.Loggerstatic final intstatic final intprivate booleanstatic final StreamCodec<RegistryFriendlyByteBuf, MobEffectInstance> private boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionMobEffectInstance(Holder<MobEffect> pEffect) MobEffectInstance(Holder<MobEffect> pEffect, int pDuration) MobEffectInstance(Holder<MobEffect> pEffect, int pDuration, int pAmplifier) MobEffectInstance(Holder<MobEffect> pEffect, int pDuration, int pAmplifier, boolean pAmbient, boolean pVisible) MobEffectInstance(Holder<MobEffect> pEffect, int pDuration, int pAmplifier, boolean pAmbient, boolean pVisible, boolean pShowIcon) MobEffectInstance(Holder<MobEffect> pEffect, int pDuration, int pAmplifier, boolean pAmbient, boolean pVisible, boolean pShowIcon, MobEffectInstance pHiddenEffect) privateMobEffectInstance(Holder<MobEffect> pEffect, MobEffectInstance.Details p_324529_) MobEffectInstance(MobEffectInstance pOther) -
Method Summary
Modifier and TypeMethodDescriptionprivate MobEffectInstance.DetailsintcompareTo(MobEffectInstance pOther) voidcopyBlendState(MobEffectInstance pEffectInstance) private Stringprivate booleanbooleanendsWithin(int pDuration) booleanintfloatgetBlendFactor(LivingEntity pEntity, float pDelta) intinthashCode()private booleanbooleanbooleanbooleanprivate booleanbooleanintmapDuration(it.unimi.dsi.fastutil.ints.Int2IntFunction pMapper) voidonEffectAdded(LivingEntity pLivingEntity) voidonEffectStarted(LivingEntity pEntity) voidonMobHurt(ServerLevel pLevel, LivingEntity pEntity, DamageSource pDamageSource, float pAmount) voidonMobRemoved(ServerLevel pLevel, LivingEntity pEntity, Entity.RemovalReason pReason) (package private) voidsetDetailsFrom(MobEffectInstance pEffectInstance) booleanshowIcon()voidvoidprivate voidbooleantickServer(ServerLevel pLevel, LivingEntity pEntity, Runnable pOnEffectUpdated) toString()booleanupdate(MobEffectInstance pOther) withScaledDuration(float pScale)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
INFINITE_DURATION
public static final int INFINITE_DURATION- See Also:
-
MIN_AMPLIFIER
public static final int MIN_AMPLIFIER- See Also:
-
MAX_AMPLIFIER
public static final int MAX_AMPLIFIER- See Also:
-
CODEC
-
STREAM_CODEC
-
effect
-
duration
private int duration -
amplifier
private int amplifier -
ambient
private boolean ambient -
visible
private boolean visible -
showIcon
private boolean showIcon -
blendState
-
-
Constructor Details
-
MobEffectInstance
-
MobEffectInstance
-
MobEffectInstance
-
MobEffectInstance
-
MobEffectInstance
-
MobEffectInstance
public MobEffectInstance(Holder<MobEffect> pEffect, int pDuration, int pAmplifier, boolean pAmbient, boolean pVisible, boolean pShowIcon, @Nullable MobEffectInstance pHiddenEffect) -
MobEffectInstance
-
MobEffectInstance
-
-
Method Details
-
asDetails
-
getBlendFactor
-
getParticleOptions
-
setDetailsFrom
-
update
-
isShorterDurationThan
-
isInfiniteDuration
public boolean isInfiniteDuration() -
endsWithin
public boolean endsWithin(int pDuration) -
withScaledDuration
-
mapDuration
public int mapDuration(it.unimi.dsi.fastutil.ints.Int2IntFunction pMapper) -
getEffect
-
getDuration
public int getDuration() -
getAmplifier
public int getAmplifier() -
isAmbient
public boolean isAmbient() -
isVisible
public boolean isVisible() -
showIcon
public boolean showIcon() -
tickServer
-
tickClient
public void tickClient() -
hasRemainingDuration
private boolean hasRemainingDuration() -
tickDownDuration
private void tickDownDuration() -
downgradeToHiddenEffect
private boolean downgradeToHiddenEffect() -
onEffectStarted
-
onMobRemoved
-
onMobHurt
public void onMobHurt(ServerLevel pLevel, LivingEntity pEntity, DamageSource pDamageSource, float pAmount) -
getDescriptionId
-
toString
-
describeDuration
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<MobEffectInstance>
-
onEffectAdded
-
is
-
copyBlendState
-
skipBlending
public void skipBlending()
-