AbsorptionMobEffect .java

net.minecraft.world.effect.AbsorptionMobEffect (class): members: onEffectStarted, shouldApplyEffectTickThisTick, applyEffectTick. imports: LivingEntity.

net.minecraft.world.effectclass27 linescommonextends MobEffect801 B

API Surface (3)

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

Code Graph: Dependencies (4)

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

Full Source

AbsorptionMobEffect.java27 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
class AbsorptionMobEffect extends MobEffect {
7
	protected AbsorptionMobEffect(final MobEffectCategory category, final int color) {
8
		super(category, color);
9
	}
10
11
	@Override
12
	public boolean applyEffectTick(final ServerLevel level, final LivingEntity mob, final int amplification) {
13
		return mob.getAbsorptionAmount() > 0.0F;
14
	}
15
16
	@Override
17
	public boolean shouldApplyEffectTickThisTick(final int tickCount, final int amplification) {
18
		return true;
19
	}
20
21
	@Override
22
	public void onEffectStarted(final LivingEntity mob, final int amplifier) {
23
		super.onEffectStarted(mob, amplifier);
24
		mob.setAbsorptionAmount(Math.max(mob.getAbsorptionAmount(), 4 * (1 + amplifier)));
25
	}
26
}
27

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