pub trait ConsumeEffectBehavior: Send + Sync {
// Required method
fn apply(
&self,
effect: &ConsumeEffectData,
world: &Arc<World>,
user: &dyn LivingEntity,
);
}Expand description
Behavior for one kind of item consume effect, such as applying, clearing, or removing status effects, playing a sound, or randomly teleporting the consumer.
Required Methods§
Sourcefn apply(
&self,
effect: &ConsumeEffectData,
world: &Arc<World>,
user: &dyn LivingEntity,
)
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".