pub struct ItemAttack {
pub damage_modifier: f64,
pub speed_modifier: Option<f64>,
pub base_damage: f64,
pub base_speed: Option<f64>,
}Expand description
What an item held in the main hand gives the player’s attack attributes, as a server applies
it (stack without an AttributeModifiers tag; see ghast_inventory for stacks).
Fields§
§damage_modifier: f64Sum of the item’s additive (operation 0) attack_damage modifiers; 0 for items without.
speed_modifier: Option<f64>Sum of the item’s additive attack_speed modifiers (None on 1.8: no attack speed
attribute).
base_damage: f64The player’s base attack damage (1.0).
base_speed: Option<f64>The player’s base attack speed (4.0; None on 1.8).
Implementations§
Source§impl ItemAttack
impl ItemAttack
Sourcepub fn attack_damage(&self) -> f64
pub fn attack_damage(&self) -> f64
The player’s attack_damage attribute value with the item held (base + modifier,
computed as EntityAttributeInstance does; vanilla items never reach the clamp).
Sourcepub fn attack_speed(&self) -> Option<f64>
pub fn attack_speed(&self) -> Option<f64>
The player’s attack_speed attribute value with the item held (None on 1.8).
Trait Implementations§
Source§impl Clone for ItemAttack
impl Clone for ItemAttack
impl Copy for ItemAttack
Source§impl Debug for ItemAttack
impl Debug for ItemAttack
Source§impl PartialEq for ItemAttack
impl PartialEq for ItemAttack
impl StructuralPartialEq for ItemAttack
Auto Trait Implementations§
impl Forget for ItemAttack
impl Freeze for ItemAttack
impl Move for ItemAttack
impl RefUnwindSafe for ItemAttack
impl Send for ItemAttack
impl Sync for ItemAttack
impl Unpin for ItemAttack
impl UnsafeUnpin for ItemAttack
impl UnwindSafe for ItemAttack
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