Skip to main content

InstantaneousMobEffect

Trait InstantaneousMobEffect 

Source
pub trait InstantaneousMobEffect: MobEffectBehavior {
    // Provided method
    fn apply_instantaneous(
        &self,
        world: &World,
        user: &dyn LivingEntity,
        amplifier: i32,
        direct_entity: Option<&SharedEntity>,
        causing_entity: Option<&SharedEntity>,
        scale: f64,
    ) { ... }
}
Expand description

The instantaneous-only half of a MobEffectBehavior that also extends vanilla InstantaneousMobEffect.

Provided Methods§

Source

fn apply_instantaneous( &self, world: &World, user: &dyn LivingEntity, amplifier: i32, direct_entity: Option<&SharedEntity>, causing_entity: Option<&SharedEntity>, scale: f64, )

Applies the instantaneous effect immediately, e.g. from drinking a potion or being hit by a splash/lingering one. direct_entity and causing_entity attribute any resulting damage, and scale applies splash/lingering falloff; the default ignores those extras and just delegates to apply_effect_tick.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§