Trait EnchantmentDamageEffect
pub trait EnchantmentDamageEffect:
Send
+ Sync
+ 'static {
// Required method
fn apply(
&self,
host: &dyn ServerHost,
context: &EnchantmentDamageContext<'_>,
value: f32,
) -> f32;
}Expand description
A registered value transformation. Called only for nodes naming this effect. The host is read-only; callbacks may be nested and must not retain hit context.
Required Methods§
fn apply(
&self,
host: &dyn ServerHost,
context: &EnchantmentDamageContext<'_>,
value: f32,
) -> f32
fn apply( &self, host: &dyn ServerHost, context: &EnchantmentDamageContext<'_>, value: f32, ) -> f32
Transform the value at this node, in vanilla enchantment and node order. NaN retains the input. Other results, including infinities, are clamped to 0..=1024 before the next node, bounding per-unit built-in work.
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".