Struct ArmorHurt
pub struct ArmorHurt {
pub slot: EquipmentSlot,
pub stack: ItemStack,
pub damage: f32,
pub new_damage: f32,
}Expand description
One armor slot of an ArmorHurtEvent: the piece in slot, the durability
damage vanilla works out for it (damage, max(1, hit / 4)) and the damage it
takes (new_damage, starts equal; a mod may change it, below 1 for none; the
game casts it to a whole number as vanilla does).
Fields§
§slot: EquipmentSlotThe equipment slot the armor piece sits in.
stack: ItemStackThe armor piece being damaged.
damage: f32The durability damage vanilla computed.
new_damage: f32The durability damage to apply instead; starts equal to damage.
Trait Implementations§
impl StructuralPartialEq for ArmorHurt
Auto Trait Implementations§
impl Freeze for ArmorHurt
impl RefUnwindSafe for ArmorHurt
impl Send for ArmorHurt
impl Sync for ArmorHurt
impl Unpin for ArmorHurt
impl UnsafeUnpin for ArmorHurt
impl UnwindSafe for ArmorHurt
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