Struct ApplyEffectTickEvent
pub struct ApplyEffectTickEvent<'a> {
pub effect: EffectKey,
pub dimension: &'a str,
pub entity: Option<i32>,
pub amplifier: i32,
pub holder: LivingRef,
pub health: f32,
pub max_health: f32,
pub food: Option<PlayerFood>,
pub keep: bool,
/* private fields */
}Expand description
What Hooks::apply_effect_tick is told. Each field is that hook’s argument of the same name, described in the hook’s doc.
Fields§
§effect: EffectKey§dimension: &'a str§entity: Option<i32>§amplifier: i32§holder: LivingRef§health: f32§max_health: f32§food: Option<PlayerFood>§keep: boolImplementations§
§impl ApplyEffectTickEvent<'_>
impl ApplyEffectTickEvent<'_>
pub fn hurt(&mut self, damage_type: &str, amount: f32)
pub fn hurt(&mut self, damage_type: &str, amount: f32)
Queue damage of a registered damage type on the holder: a vanilla
one (minecraft:magic, minecraft:wither) or a datapack’s
(demo:heat). It reaches the holder’s hurt hooks with that type; an
unregistered type hurts nothing.
pub fn add_exhaustion(&mut self, amount: f32)
pub fn add_exhaustion(&mut self, amount: f32)
Queue food exhaustion; a non-player holder ignores it.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !UnwindSafe for ApplyEffectTickEvent<'a>
impl<'a> Freeze for ApplyEffectTickEvent<'a>
impl<'a> RefUnwindSafe for ApplyEffectTickEvent<'a>
impl<'a> Send for ApplyEffectTickEvent<'a>
impl<'a> Sync for ApplyEffectTickEvent<'a>
impl<'a> Unpin for ApplyEffectTickEvent<'a>
impl<'a> UnsafeUnpin for ApplyEffectTickEvent<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more