RegenerationMobEffect .java

net.minecraft.world.effect.RegenerationMobEffect (class, 26 lines): members: shouldApplyEffectTickThisTick, applyEffectTick. imports: LivingEntity.

net.minecraft.world.effectclass26 linescommonextends MobEffect711 B

API Surface (2)

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

Code Graph: Dependencies (4)

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

Full Source

RegenerationMobEffect.java26 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 RegenerationMobEffect extends MobEffect {
7
	protected RegenerationMobEffect(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
		if (mob.getHealth() < mob.getMaxHealth()) {
14
			mob.heal(1.0F);
15
		}
16
17
		return true;
18
	}
19
20
	@Override
21
	public boolean shouldApplyEffectTickThisTick(final int tickCount, final int amplification) {
22
		int interval = 50 >> amplification;
23
		return interval > 0 ? tickCount % interval == 0 : true;
24
	}
25
}
26

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