Package net.minecraft.world.effect
Class MobEffect
java.lang.Object
net.minecraft.world.effect.MobEffect
- All Implemented Interfaces:
FeatureElement
,IForgeMobEffect
- 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_335432_, int p_334901_, ParticleOptions p_331136_) -
Method Summary
Modifier and TypeMethodDescriptionaddAttributeModifier
(Holder<Attribute> p_332101_, String p_19474_, double p_19475_, AttributeModifier.Operation p_19476_) void
addAttributeModifiers
(AttributeMap p_19479_, int p_19480_) boolean
applyEffectTick
(LivingEntity p_333541_, int p_333570_) void
applyInstantenousEffect
(Entity p_19462_, Entity p_19463_, LivingEntity p_19464_, int p_19465_, double p_19466_) void
createModifiers
(int p_334564_, BiConsumer<Holder<Attribute>, AttributeModifier> p_333602_) createParticleOptions
(MobEffectInstance p_332465_) int
int
getColor()
protected String
private void
void
initializeClient
(Consumer<IClientMobEffectExtensions> consumer) boolean
boolean
void
onEffectAdded
(LivingEntity p_335100_, int p_336309_) void
onEffectStarted
(LivingEntity p_299085_, int p_297449_) void
onMobHurt
(LivingEntity p_19467_, int p_19468_, DamageSource p_334111_, float p_330556_) void
onMobRemoved
(LivingEntity p_335815_, int p_328980_, Entity.RemovalReason p_328413_) void
removeAttributeModifiers
(AttributeMap p_19470_) requiredFeatures
(FeatureFlag... p_329270_) setBlendDuration
(int p_328727_) boolean
shouldApplyEffectTickThisTick
(int p_297908_, int p_301085_) withSoundOnAdded
(SoundEvent p_329951_) 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.minecraftforge.common.extensions.IForgeMobEffect
getCurativeItems, 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_297908_, int p_301085_) -
onEffectStarted
-
onEffectAdded
-
onMobRemoved
-
onMobHurt
-
isInstantenous
public boolean isInstantenous() -
getOrCreateDescriptionId
-
getDescriptionId
-
getDisplayName
-
getCategory
-
getColor
public int getColor() -
addAttributeModifier
public MobEffect addAttributeModifier(Holder<Attribute> p_332101_, String p_19474_, double p_19475_, AttributeModifier.Operation p_19476_) -
setBlendDuration
-
createModifiers
public void createModifiers(int p_334564_, BiConsumer<Holder<Attribute>, AttributeModifier> p_333602_) -
removeAttributeModifiers
-
addAttributeModifiers
-
isBeneficial
public boolean isBeneficial() -
createParticleOptions
-
withSoundOnAdded
-
requiredFeatures
-
requiredFeatures
- Specified by:
requiredFeatures
in interfaceFeatureElement
-
getEffectRendererInternal
-
initClient
private void initClient() -
initializeClient
-