Struct ShieldBlock
pub struct ShieldBlock {
pub blocked: bool,
pub blocked_damage: f32,
pub shield_damage: i32,
}Expand description
What a player’s raised blocking item does to a hit, as native_living_shield_block
may change it (LivingShieldBlockEvent).
Fields§
§blocked: boolThe player counts as blocking.
The damage sequence’s blocked value.
blocked_damage: f32The damage the item stops, kept within 0 and the hit’s damage.
shield_damage: i32The durability the item loses (ItemDamageFunction of what it stops). Below 0,
vanilla’s ItemDamageFunction of the final blocked_damage applies.
The damage sequence’s shield_damage value.
Trait Implementations§
§impl Clone for ShieldBlock
impl Clone for ShieldBlock
§fn clone(&self) -> ShieldBlock
fn clone(&self) -> ShieldBlock
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 moreimpl Copy for ShieldBlock
§impl Debug for ShieldBlock
impl Debug for ShieldBlock
§impl PartialEq for ShieldBlock
impl PartialEq for ShieldBlock
impl StructuralPartialEq for ShieldBlock
Auto Trait Implementations§
impl Freeze for ShieldBlock
impl RefUnwindSafe for ShieldBlock
impl Send for ShieldBlock
impl Sync for ShieldBlock
impl Unpin for ShieldBlock
impl UnsafeUnpin for ShieldBlock
impl UnwindSafe for ShieldBlock
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