Package net.minecraft.world.effect
Class MobEffectInstance
java.lang.Object
net.minecraft.world.effect.MobEffectInstance
- All Implemented Interfaces:
Comparable<MobEffectInstance>
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static class
(package private) static final record
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private int
private final MobEffectInstance.BlendState
static final com.mojang.serialization.Codec
<MobEffectInstance> private final Set
<EffectCure> private int
private MobEffectInstance
static final int
private static final org.slf4j.Logger
static final int
static final int
private boolean
static final StreamCodec
<RegistryFriendlyByteBuf, MobEffectInstance> private boolean
-
Constructor Summary
ModifierConstructorDescriptionMobEffectInstance
(Holder<MobEffect> p_316782_) MobEffectInstance
(Holder<MobEffect> p_316473_, int p_19523_) MobEffectInstance
(Holder<MobEffect> p_316819_, int p_216888_, int p_216889_) MobEffectInstance
(Holder<MobEffect> p_316846_, int p_19516_, int p_316691_, boolean p_316120_, boolean p_316433_) MobEffectInstance
(Holder<MobEffect> p_316870_, int p_316726_, int p_316828_, boolean p_316179_, boolean p_316397_, boolean p_316398_) MobEffectInstance
(Holder<MobEffect> p_316176_, int p_19529_, int p_19530_, boolean p_19531_, boolean p_19532_, boolean p_19533_, MobEffectInstance p_316863_) private
MobEffectInstance
(Holder<MobEffect> p_324441_, MobEffectInstance.Details p_324529_) MobEffectInstance
(MobEffectInstance p_19543_) -
Method Summary
Modifier and TypeMethodDescriptionprivate MobEffectInstance.Details
int
compareTo
(MobEffectInstance p_19566_) void
copyBlendState
(MobEffectInstance p_316485_) private String
boolean
endsWithin
(int p_268088_) boolean
int
float
getBlendFactor
(LivingEntity p_316410_, float p_316194_) getCures()
int
int
hashCode()
private boolean
boolean
boolean
boolean
private boolean
isShorterDurationThan
(MobEffectInstance p_268133_) boolean
static MobEffectInstance
load
(CompoundTag p_19561_) int
mapDuration
(it.unimi.dsi.fastutil.ints.Int2IntFunction p_268089_) void
onEffectAdded
(LivingEntity p_338286_) void
onEffectStarted
(LivingEntity p_295220_) void
onMobHurt
(LivingEntity p_338201_, DamageSource p_338572_, float p_338779_) void
onMobRemoved
(LivingEntity p_338566_, Entity.RemovalReason p_338384_) save()
(package private) void
setDetailsFrom
(MobEffectInstance p_19549_) boolean
showIcon()
void
boolean
tick
(LivingEntity p_19553_, Runnable p_19554_) private int
toString()
boolean
update
(MobEffectInstance p_19559_)
-
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
-
cures
-
-
Constructor Details
-
MobEffectInstance
-
MobEffectInstance
-
MobEffectInstance
-
MobEffectInstance
-
MobEffectInstance
-
MobEffectInstance
public MobEffectInstance(Holder<MobEffect> p_316176_, int p_19529_, int p_19530_, boolean p_19531_, boolean p_19532_, boolean p_19533_, @Nullable MobEffectInstance p_316863_) -
MobEffectInstance
-
MobEffectInstance
-
-
Method Details
-
asDetails
-
getBlendFactor
-
getParticleOptions
-
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
-
onMobRemoved
-
onMobHurt
-
getDescriptionId
-
toString
-
describeDuration
-
equals
-
hashCode
public int hashCode() -
save
-
load
-
compareTo
- Specified by:
compareTo
in interfaceComparable<MobEffectInstance>
-
onEffectAdded
-
is
-
copyBlendState
-
skipBlending
public void skipBlending() -
getCures
- Returns:
- the
EffectCure
s which can cure theMobEffect
held by thisMobEffectInstance
-