Struct HurtSource
pub struct HurtSource<'a> {
pub damage_type: &'a str,
pub causing: i32,
pub direct: i32,
pub position: Option<[f64; 3]>,
}Expand description
A hit’s DamageSource for HURT_SERVER: its type (minecraft:fall),
the entity ids of getEntity (causing) and getDirectEntity
(direct), 0 for none or not known, and where it comes from
(getSourcePosition), none when not known.
Fields§
§damage_type: &'a str§causing: i32§direct: i32The projectile’s entity id when the damage type names one (an arrow, a thrown
entity, an owned wither skull), including an ownerless projectile; the attacker
itself for melee when known. 0 when the source names none, including magic()
dealt during a projectile’s impact (an ownerless wither skull, a tipped arrow’s
instant harm).
position: Option<[f64; 3]>Trait Implementations§
§impl<'a> Clone for HurtSource<'a>
impl<'a> Clone for HurtSource<'a>
§fn clone(&self) -> HurtSource<'a>
fn clone(&self) -> HurtSource<'a>
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<'a> Copy for HurtSource<'a>
§impl<'a> Debug for HurtSource<'a>
impl<'a> Debug for HurtSource<'a>
§impl<'a> PartialEq for HurtSource<'a>
impl<'a> PartialEq for HurtSource<'a>
impl<'a> StructuralPartialEq for HurtSource<'a>
Auto Trait Implementations§
impl<'a> Freeze for HurtSource<'a>
impl<'a> RefUnwindSafe for HurtSource<'a>
impl<'a> Send for HurtSource<'a>
impl<'a> Sync for HurtSource<'a>
impl<'a> Unpin for HurtSource<'a>
impl<'a> UnsafeUnpin for HurtSource<'a>
impl<'a> UnwindSafe for HurtSource<'a>
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