pub struct AttributeModifier {
pub attribute_id: RegistryId,
pub modifier_id: Ident<String>,
pub value: f64,
pub operation: EntityAttributeOperation,
pub slot: AttributeSlot,
}Expand description
Modifies a player’s attributes (like Strength or Speed).
Fields§
§attribute_id: RegistryIdThe ID of the attribute to modify in the registry.
modifier_id: Ident<String>A unique identifier for this modifier instance. Used to prevent stacking the same modifier multiple times from different sources.
value: f64The numerical amount to change the attribute by.
operation: EntityAttributeOperationHow the math is applied.
(Add): X = X + Value
(Multiply Base): X = X + (BaseValue * Value)
(Multiply Total): X = X * (1 + Value)
slot: AttributeSlotWhich slot the item must be in for this to work.
Trait Implementations§
Source§impl Clone for AttributeModifier
impl Clone for AttributeModifier
Source§fn clone(&self) -> AttributeModifier
fn clone(&self) -> AttributeModifier
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AttributeModifier
impl Debug for AttributeModifier
Source§impl<'a> Decode<'a> for AttributeModifier
impl<'a> Decode<'a> for AttributeModifier
Source§impl Encode for AttributeModifier
impl Encode for AttributeModifier
Source§impl PartialEq for AttributeModifier
impl PartialEq for AttributeModifier
impl StructuralPartialEq for AttributeModifier
Auto Trait Implementations§
impl Freeze for AttributeModifier
impl RefUnwindSafe for AttributeModifier
impl Send for AttributeModifier
impl Sync for AttributeModifier
impl Unpin for AttributeModifier
impl UnwindSafe for AttributeModifier
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more