pub struct ContainerClickEvent {
pub window_id: u8,
pub backing: ContainerBacking,
pub slot_index: i16,
pub window_slot_kind: WindowSlotKind,
pub click_type: ContainerClickType,
pub cursor_before: Slot,
pub cancelled: bool,
}Expand description
Fires BEFORE a click inside an open container is applied.
Cancellable – plugins use this to implement GUI menus where slots act as buttons. Fires during the Validate stage.
Only fires when a container is open (NOT for player inventory clicks with no open container).
Fields§
§window_id: u8Window ID of the open container.
backing: ContainerBackingHow the container is backed.
slot_index: i16Protocol slot index that was clicked.
window_slot_kind: WindowSlotKindLogical categorisation of the clicked slot.
click_type: ContainerClickTypeType of click action (left, right, shift, etc.).
cursor_before: SlotCursor item state immediately before the click.
cancelled: boolWhether the event has been cancelled.
Trait Implementations§
Source§impl Clone for ContainerClickEvent
impl Clone for ContainerClickEvent
Source§fn clone(&self) -> ContainerClickEvent
fn clone(&self) -> ContainerClickEvent
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 ContainerClickEvent
impl Debug for ContainerClickEvent
Source§impl Event for ContainerClickEvent
impl Event for ContainerClickEvent
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 ContainerClickEvent
impl EventRouting for ContainerClickEvent
Auto Trait Implementations§
impl Freeze for ContainerClickEvent
impl RefUnwindSafe for ContainerClickEvent
impl Send for ContainerClickEvent
impl Sync for ContainerClickEvent
impl Unpin for ContainerClickEvent
impl UnsafeUnpin for ContainerClickEvent
impl UnwindSafe for ContainerClickEvent
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