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/// Raid omen mob effect behavior.
8// TODO: `applyEffectTick` checks the mob is a non-spectator `ServerPlayer`
9// with a pending raid-omen position, then calls `level.getRaids()
10// .createOrExtendRaid(player, pos)` and clears the position, removing this
11// effect (returns `false`).
12pub struct RaidOmenBehavior;
13
14impl MobEffectBehavior for RaidOmenBehavior {
15    fn should_apply_effect_tick_this_tick(&self, tick_count: i32, _amplifier: i32) -> bool {
16        tick_count == 1
17    }
18
19    fn apply_effect_tick(&self, _world: &World, _user: &dyn LivingEntity, _amplifier: i32) -> bool {
20        true
21    }
22}