Struct ActiveEffect
#[non_exhaustive]pub struct ActiveEffect {
pub id: EffectKey,
pub duration: i32,
pub amplifier: i32,
pub ambient: bool,
pub visible: bool,
pub show_icon: bool,
}Expand description
A living entity’s active effect (vanilla’s MobEffectInstance), as
LivingRef reads its effects and as add_effect gives one: the
effect’s id, an Identifier namespaced as the registry has it
(minecraft:speed, a content mod’s mod:custom),
the ticks left (-1 is infinite), the amplifier from 0, and the flags a
beacon-style effect carries: ambient (an ambient one gives no
particles), visible (whether its particles show) and show_icon
(whether the HUD and inventory list it).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: EffectKeyThe effect’s load-owned registry key; id.id(host) reads its canonical name.
duration: i32The ticks left; -1 is infinite.
amplifier: i32The amplifier, from 0.
ambient: boolMobEffectInstance.isAmbient: an ambient effect shows no particles.
visible: boolMobEffectInstance.isVisible: whether its particles show.
show_icon: boolMobEffectInstance.showIcon: whether the HUD and the inventory list
it. Vanilla keeps it apart from visible.
Implementations§
§impl ActiveEffect
impl ActiveEffect
Trait Implementations§
§impl Clone for ActiveEffect
impl Clone for ActiveEffect
§fn clone(&self) -> ActiveEffect
fn clone(&self) -> ActiveEffect
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more