RaidOmenMobEffect .java

net.minecraft.world.effect.RaidOmenMobEffect (class): members: shouldApplyEffectTickThisTick, applyEffectTick. imports: ParticleOptions, ServerPlayer.

net.minecraft.world.effectclass33 linescommonextends MobEffect1.0 KB

API Surface (2)

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

Code Graph: Dependencies (7)

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

Full Source

RaidOmenMobEffect.java33 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.effect;
2
3
import net.minecraft.core.BlockPos;
4
import net.minecraft.core.particles.ParticleOptions;
5
import net.minecraft.server.level.ServerLevel;
6
import net.minecraft.server.level.ServerPlayer;
7
import net.minecraft.world.entity.LivingEntity;
8
9
class RaidOmenMobEffect extends MobEffect {
10
	protected RaidOmenMobEffect(final MobEffectCategory category, final int color, final ParticleOptions particleOptions) {
11
		super(category, color, particleOptions);
12
	}
13
14
	@Override
15
	public boolean shouldApplyEffectTickThisTick(final int remainingDuration, final int amplification) {
16
		return remainingDuration == 1;
17
	}
18
19
	@Override
20
	public boolean applyEffectTick(final ServerLevel level, final LivingEntity mob, final int amplification) {
21
		if (mob instanceof ServerPlayer player && !mob.isSpectator()) {
22
			BlockPos raidOmenPosition = player.getRaidOmenPosition();
23
			if (raidOmenPosition != null) {
24
				level.getRaids().createOrExtendRaid(player, raidOmenPosition);
25
				player.clearRaidOmenPosition();
26
				return false;
27
			}
28
		}
29
30
		return true;
31
	}
32
}
33

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