WitherMobEffect .java

net.minecraft.world.effect.WitherMobEffect (class): members: DAMAGE_INTERVAL, shouldApplyEffectTickThisTick, applyEffectTick. imports: LivingEntity.

net.minecraft.world.effectclass25 linescommonextends MobEffect745 B

API Surface (2)

boolean applyEffectTick(final ServerLevel level, final LivingEntity mob, final int amplification)
boolean shouldApplyEffectTickThisTick(final int tickCount, final int amplification)

Fields & Constants (1)

DAMAGE_INTERVAL

Code Graph: Dependencies (4)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

WitherMobEffect.java25 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.effect;
2
3
import net.minecraft.server.level.ServerLevel;
4
import net.minecraft.world.entity.LivingEntity;
5
6
public class WitherMobEffect extends MobEffect {
7
	public static final int DAMAGE_INTERVAL = 40;
8
9
	protected WitherMobEffect(final MobEffectCategory category, final int color) {
10
		super(category, color);
11
	}
12
13
	@Override
14
	public boolean applyEffectTick(final ServerLevel level, final LivingEntity mob, final int amplification) {
15
		mob.hurtServer(level, mob.damageSources().wither(), 1.0F);
16
		return true;
17
	}
18
19
	@Override
20
	public boolean shouldApplyEffectTickThisTick(final int tickCount, final int amplification) {
21
		int interval = 40 >> amplification;
22
		return interval > 0 ? tickCount % interval == 0 : true;
23
	}
24
}
25

Decompiled Minecraft 26.3 source of WitherMobEffect (net/minecraft/world/effect/WitherMobEffect.java) with Mojang official mappings, stored verbatim on the site.