Struct BlockClick
#[non_exhaustive]pub struct BlockClick<'a> {
pub side: LogicalSide,
pub dimension: Dimension,
pub pos: [i32; 3],
pub hit: BlockHit,
pub hand: Hand,
pub stack: Option<&'a ItemStack>,
pub player: u128,
pub player_entity_id: i32,
}Expand description
A player’s right click on a block, shared by the block’s use behaviours
and right_click_block (PlayerInteractEvent.RightClickBlock). The
event hears it once per hand on the clicking client and on the server.
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.side: LogicalSideThe side running the click (getSide).
dimension: DimensionThe clicking player’s level (getLevel).
pos: [i32; 3]The block clicked (getPos).
hit: BlockHitWhere it was clicked (getHitVec); hit.face is getFace.
hand: HandThe hand clicking (getHand) and what it holds (getItemStack).
stack: Option<&'a ItemStack>The stack.
player: u128The clicking player’s UUID and entity id (getEntity).
player_entity_id: i32The player entity id.
Trait Implementations§
§impl<'a> Clone for BlockClick<'a>
impl<'a> Clone for BlockClick<'a>
§fn clone(&self) -> BlockClick<'a>
fn clone(&self) -> BlockClick<'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 BlockClick<'a>
§impl<'a> Debug for BlockClick<'a>
impl<'a> Debug for BlockClick<'a>
§impl<'a> From<BlockClick<'a>> for BlockClick<'a>
impl<'a> From<BlockClick<'a>> for BlockClick<'a>
§fn from(v: BlockClick<'a>) -> BlockClick<'a>
fn from(v: BlockClick<'a>) -> BlockClick<'a>
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a> Freeze for BlockClick<'a>
impl<'a> RefUnwindSafe for BlockClick<'a>
impl<'a> Send for BlockClick<'a>
impl<'a> Sync for BlockClick<'a>
impl<'a> Unpin for BlockClick<'a>
impl<'a> UnsafeUnpin for BlockClick<'a>
impl<'a> UnwindSafe for BlockClick<'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