Struct ItemAttributeModifier
#[non_exhaustive]pub struct ItemAttributeModifier {
pub attribute: Identifier,
pub modifier: AttributeModifier,
pub slot: EquipmentSlotGroup,
}Expand description
One attribute modifier an item stack grants (vanilla’s
ItemAttributeModifiers.Entry): the attribute (minecraft:armor), the
modifier, and the slots it applies in.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.attribute: IdentifierThe attribute’s id.
modifier: AttributeModifierThe modifier.
slot: EquipmentSlotGroupThe slots it applies in.
Implementations§
§impl ItemAttributeModifier
impl ItemAttributeModifier
pub fn new(
attribute: Identifier,
modifier: AttributeModifier,
slot: EquipmentSlotGroup,
) -> ItemAttributeModifier
pub fn new( attribute: Identifier, modifier: AttributeModifier, slot: EquipmentSlotGroup, ) -> ItemAttributeModifier
modifier on attribute, in the slots of slot.
Trait Implementations§
§impl Clone for ItemAttributeModifier
impl Clone for ItemAttributeModifier
§fn clone(&self) -> ItemAttributeModifier
fn clone(&self) -> ItemAttributeModifier
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for ItemAttributeModifier
impl Debug for ItemAttributeModifier
§impl PartialEq for ItemAttributeModifier
impl PartialEq for ItemAttributeModifier
impl StructuralPartialEq for ItemAttributeModifier
Auto Trait Implementations§
impl Freeze for ItemAttributeModifier
impl RefUnwindSafe for ItemAttributeModifier
impl Send for ItemAttributeModifier
impl Sync for ItemAttributeModifier
impl Unpin for ItemAttributeModifier
impl UnsafeUnpin for ItemAttributeModifier
impl UnwindSafe for ItemAttributeModifier
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