pub struct PlayerInteractEvent {
pub position: BlockPosition,
pub block_state: u16,
pub direction: i32,
pub sequence: i32,
pub cancelled: bool,
}Expand description
A player right-clicked on a block.
Fired before any container interaction or block placement.
If cancelled (e.g., ContainerPlugin opens a chest), the game
loop skips block placement. The interacting player is available
via ctx.player().
Fields§
§position: BlockPositionPosition of the clicked block.
block_state: u16Block state at the clicked position.
direction: i32Face direction clicked (0-5).
sequence: i32Sequence number for acknowledgement.
cancelled: boolWhether this event has been cancelled.
Trait Implementations§
Source§impl Clone for PlayerInteractEvent
impl Clone for PlayerInteractEvent
Source§fn clone(&self) -> PlayerInteractEvent
fn clone(&self) -> PlayerInteractEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PlayerInteractEvent
impl Debug for PlayerInteractEvent
Source§impl Event for PlayerInteractEvent
impl Event for PlayerInteractEvent
Source§fn is_cancelled(&self) -> bool
fn is_cancelled(&self) -> bool
Whether this event has been cancelled by a Validate handler.
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Upcasts to
&mut dyn Any for mutable type-erased dispatch.Source§impl EventRouting for PlayerInteractEvent
impl EventRouting for PlayerInteractEvent
Auto Trait Implementations§
impl Freeze for PlayerInteractEvent
impl RefUnwindSafe for PlayerInteractEvent
impl Send for PlayerInteractEvent
impl Sync for PlayerInteractEvent
impl Unpin for PlayerInteractEvent
impl UnsafeUnpin for PlayerInteractEvent
impl UnwindSafe for PlayerInteractEvent
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