Class InfestedMobEffect
java.lang.Object
net.minecraft.world.effect.MobEffect
net.minecraft.world.effect.InfestedMobEffect
- All Implemented Interfaces:
FeatureElement, IMobEffectExtension
-
Nested Class Summary
Nested classes/interfaces inherited from class MobEffect
MobEffect.AttributeTemplate -
Field Summary
FieldsFields inherited from class MobEffect
CODEC, STREAM_CODECFields inherited from interface FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInfestedMobEffect(MobEffectCategory category, int color, float chanceToSpawn, ToIntFunction<RandomSource> spawnedCount) -
Method Summary
Modifier and TypeMethodDescriptionvoidonMobHurt(ServerLevel level, LivingEntity mob, int amplifier, DamageSource source, float damage) private voidspawnSilverfish(ServerLevel level, LivingEntity mob, double x, double y, double z) Methods inherited from class MobEffect
addAttributeModifier, addAttributeModifier, addAttributeModifiers, applyEffectTick, applyInstantenousEffect, createModifiers, createParticleOptions, getBlendInDurationTicks, getBlendOutAdvanceTicks, getBlendOutDurationTicks, getCategory, getColor, getDescriptionId, getDisplayName, getOrCreateDescriptionId, isBeneficial, isInstantenous, onEffectAdded, onEffectStarted, onMobRemoved, removeAttributeModifiers, requiredFeatures, requiredFeatures, setBlendDuration, setBlendDuration, shouldApplyEffectTickThisTick, withSoundOnAddedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface FeatureElement
isEnabledMethods inherited from interface IMobEffectExtension
getSortOrder
-
Field Details
-
chanceToSpawn
private final float chanceToSpawn -
spawnedCount
-
-
Constructor Details
-
InfestedMobEffect
protected InfestedMobEffect(MobEffectCategory category, int color, float chanceToSpawn, ToIntFunction<RandomSource> spawnedCount)
-
-
Method Details
-
onMobHurt
public void onMobHurt(ServerLevel level, LivingEntity mob, int amplifier, DamageSource source, float damage) -
spawnSilverfish
-