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 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_333937_) MobEffectInstance
(Holder<MobEffect> p_332556_, int p_19523_) MobEffectInstance
(Holder<MobEffect> p_334453_, int p_328066_, int p_330997_) MobEffectInstance
(Holder<MobEffect> p_327781_, int p_19529_, int p_19530_, boolean p_19531_, boolean p_19532_) MobEffectInstance
(Holder<MobEffect> p_333122_, int p_216888_, int p_216889_, boolean p_216890_, boolean p_216891_, boolean p_216892_) MobEffectInstance
(Holder<MobEffect> p_334558_, int p_19519_, int p_19520_, boolean p_332448_, boolean p_327855_, boolean p_334281_, MobEffectInstance p_332569_) private
MobEffectInstance
(Holder<MobEffect> p_330051_, MobEffectInstance.Details p_332322_) MobEffectInstance
(MobEffectInstance p_19543_) -
Method Summary
Modifier and TypeMethodDescriptionprivate MobEffectInstance.Details
int
compareTo
(MobEffectInstance p_19566_) void
copyBlendState
(MobEffectInstance p_335404_) private String
boolean
endsWithin
(int p_268088_) boolean
int
float
getBlendFactor
(LivingEntity p_333473_, float p_327866_) 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_334348_) void
onEffectStarted
(LivingEntity p_297679_) void
onMobHurt
(LivingEntity p_327684_, DamageSource p_328403_, float p_331463_) void
onMobRemoved
(LivingEntity p_329318_, Entity.RemovalReason p_333232_) 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
-
-
Constructor Details
-
MobEffectInstance
-
MobEffectInstance
-
MobEffectInstance
-
MobEffectInstance
-
MobEffectInstance
-
MobEffectInstance
public MobEffectInstance(Holder<MobEffect> p_334558_, int p_19519_, int p_19520_, boolean p_332448_, boolean p_327855_, boolean p_334281_, @Nullable MobEffectInstance p_332569_) -
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()
-