Skip to main content

ConsumeEffectBehavior

Trait ConsumeEffectBehavior 

Source
pub trait ConsumeEffectBehavior: Send + Sync {
    // Required method
    fn apply(
        &self,
        effect: &ConsumeEffectData,
        world: &Arc<World>,
        user: &dyn LivingEntity,
    );
}
Expand description

Mirrors vanilla’s ConsumeEffect.apply(Level, ItemStack, LivingEntity)

Required Methods§

Source

fn apply( &self, effect: &ConsumeEffectData, world: &Arc<World>, user: &dyn LivingEntity, )

Applies this effect’s behavior to user, downcasting effect to the concrete ConsumeEffectData payload this behavior expects.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§