Skip to main content

steel_core/entity/mob_effect/
raid_omen.rs

1//! `RaidOmenMobEffect` behavior.
2
3use super::MobEffectBehavior;
4use crate::entity::LivingEntity;
5use crate::world::World;
6
7/// Mirrors vanilla `RaidOmenMobEffect`.
8///
9// TODO: `applyEffectTick` checks the mob is a non-spectator `ServerPlayer`
10// with a pending raid-omen position, then calls `level.getRaids()
11// .createOrExtendRaid(player, pos)` and clears the position, removing this
12// effect (returns `false`).
13pub struct RaidOmenBehavior;
14
15impl MobEffectBehavior for RaidOmenBehavior {
16    fn should_apply_effect_tick_this_tick(&self, tick_count: i32, _amplifier: i32) -> bool {
17        tick_count == 1
18    }
19
20    fn apply_effect_tick(&self, _world: &World, _user: &dyn LivingEntity, _amplifier: i32) -> bool {
21        true
22    }
23}