Package net.minecraft.world.effect
Class MobEffect
java.lang.Object
net.minecraft.world.effect.MobEffect
- All Implemented Interfaces:
FeatureElement
,IMobEffectExtension
- Direct Known Subclasses:
AbsorptionMobEffect
,BadOmenMobEffect
,HungerMobEffect
,InfestedMobEffect
,InstantenousMobEffect
,OozingMobEffect
,PoisonMobEffect
,RaidOmenMobEffect
,RegenerationMobEffect
,WeavingMobEffect
,WindChargedMobEffect
,WitherMobEffect
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static final record
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final int
private final Map
<Holder<Attribute>, MobEffect.AttributeTemplate> private int
private final MobEffectCategory
private final int
private String
private Object
private final Function
<MobEffectInstance, ParticleOptions> private FeatureFlagSet
private Optional
<SoundEvent> Fields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES
-
Constructor Summary
ModifierConstructorDescriptionprotected
MobEffect
(MobEffectCategory p_19451_, int p_19452_) protected
MobEffect
(MobEffectCategory p_333963_, int p_333864_, ParticleOptions p_333716_) -
Method Summary
Modifier and TypeMethodDescriptionaddAttributeModifier
(Holder<Attribute> p_316656_, String p_19474_, double p_19475_, AttributeModifier.Operation p_19476_) void
addAttributeModifiers
(AttributeMap p_19479_, int p_19480_) boolean
applyEffectTick
(LivingEntity p_19467_, int p_19468_) void
applyInstantenousEffect
(Entity p_19462_, Entity p_19463_, LivingEntity p_19464_, int p_19465_, double p_19466_) void
createModifiers
(int p_316803_, BiConsumer<Holder<Attribute>, AttributeModifier> p_316902_) createParticleOptions
(MobEffectInstance p_333815_) int
int
getColor()
protected String
private void
void
initializeClient
(Consumer<IClientMobEffectExtensions> consumer) boolean
boolean
void
onEffectAdded
(LivingEntity p_338333_, int p_338715_) void
onEffectStarted
(LivingEntity p_296490_, int p_296147_) void
onMobHurt
(LivingEntity p_338186_, int p_338204_, DamageSource p_338393_, float p_338618_) void
onMobRemoved
(LivingEntity p_338500_, int p_338476_, Entity.RemovalReason p_338373_) void
removeAttributeModifiers
(AttributeMap p_19470_) requiredFeatures
(FeatureFlag... p_338702_) setBlendDuration
(int p_316265_) boolean
shouldApplyEffectTickThisTick
(int p_295329_, int p_295167_) withSoundOnAdded
(SoundEvent p_338383_) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabled
Methods inherited from interface net.neoforged.neoforge.common.extensions.IMobEffectExtension
fillEffectCures, getSortOrder
-
Field Details
-
AMBIENT_ALPHA
private static final int AMBIENT_ALPHA -
attributeModifiers
-
category
-
color
private final int color -
particleFactory
-
descriptionId
-
blendDurationTicks
private int blendDurationTicks -
soundOnAdded
-
requiredFeatures
-
effectRenderer
-
-
Constructor Details
-
MobEffect
-
MobEffect
-
-
Method Details
-
getBlendDurationTicks
public int getBlendDurationTicks() -
applyEffectTick
-
applyInstantenousEffect
public void applyInstantenousEffect(@Nullable Entity p_19462_, @Nullable Entity p_19463_, LivingEntity p_19464_, int p_19465_, double p_19466_) -
shouldApplyEffectTickThisTick
public boolean shouldApplyEffectTickThisTick(int p_295329_, int p_295167_) -
onEffectStarted
-
onEffectAdded
-
onMobRemoved
-
onMobHurt
public void onMobHurt(LivingEntity p_338186_, int p_338204_, DamageSource p_338393_, float p_338618_) -
isInstantenous
public boolean isInstantenous() -
getOrCreateDescriptionId
-
getDescriptionId
-
getDisplayName
-
getCategory
-
getColor
public int getColor() -
addAttributeModifier
public MobEffect addAttributeModifier(Holder<Attribute> p_316656_, String p_19474_, double p_19475_, AttributeModifier.Operation p_19476_) -
setBlendDuration
-
createModifiers
public void createModifiers(int p_316803_, BiConsumer<Holder<Attribute>, AttributeModifier> p_316902_) -
removeAttributeModifiers
-
addAttributeModifiers
-
isBeneficial
public boolean isBeneficial() -
createParticleOptions
-
withSoundOnAdded
-
requiredFeatures
-
requiredFeatures
- Specified by:
requiredFeatures
in interfaceFeatureElement
-
getEffectRendererInternal
-
initClient
private void initClient() -
initializeClient
-