SaturationMobEffect .java

net.minecraft.world.effect.SaturationMobEffect (class, 21 lines): extends InstantaneousMobEffect. members: applyEffectTick. imports: Player.

net.minecraft.world.effectclass21 linescommonextends InstantaneousMobEffect591 B

API Surface (1)

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

Code Graph: Dependencies (5)

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

Full Source

SaturationMobEffect.java21 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
import net.minecraft.world.entity.player.Player;
6
7
class SaturationMobEffect extends InstantaneousMobEffect {
8
	protected SaturationMobEffect(final MobEffectCategory category, final int color) {
9
		super(category, color);
10
	}
11
12
	@Override
13
	public boolean applyEffectTick(final ServerLevel level, final LivingEntity mob, final int amplification) {
14
		if (mob instanceof Player player) {
15
			player.getFoodData().eat(amplification + 1, 1.0F);
16
		}
17
18
		return true;
19
	}
20
}
21

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