Struct ToolUse
#[non_exhaustive]pub struct ToolUse {
pub player: Option<u32>,
pub hand: Hand,
pub pos: [i32; 3],
pub face: [i32; 3],
pub click: [f64; 3],
pub ability: ToolAbility,
pub simulated: bool,
}Expand description
Read-only context for a tool modification.
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.player: Option<u32>The acting entity ID, if present.
hand: HandThe hand holding the tool.
pos: [i32; 3]The clicked block position.
face: [i32; 3]The clicked face’s direction.
click: [f64; 3]The click position in world coordinates.
ability: ToolAbilityThe action being considered.
simulated: boolWhether this is a simulation. Preview calls pass true; actual use passes false.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ToolUse
impl RefUnwindSafe for ToolUse
impl Send for ToolUse
impl Sync for ToolUse
impl Unpin for ToolUse
impl UnsafeUnpin for ToolUse
impl UnwindSafe for ToolUse
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