pub struct ContainerOpenedEvent {
pub window_id: u8,
pub inventory_type: InventoryType,
pub backing: ContainerBacking,
pub viewer_count: u32,
}Expand description
Fires AFTER a container window has been opened for a player.
Non-cancellable. Fires during the Post stage.
Fields§
§window_id: u8Protocol window ID assigned at open time (1-127).
inventory_type: InventoryTypeThe inventory type that was opened.
backing: ContainerBackingHow the container is backed.
viewer_count: u32Number of players viewing the same block-backed container,
including the player who just opened it. Always at least 1
for Block backings, 0 for Virtual backings (each virtual
container is per-player).
Used by ContainerPlugin to broadcast the chest-lid open
animation with the right viewer count.
Trait Implementations§
Source§impl Clone for ContainerOpenedEvent
impl Clone for ContainerOpenedEvent
Source§fn clone(&self) -> ContainerOpenedEvent
fn clone(&self) -> ContainerOpenedEvent
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 ContainerOpenedEvent
impl Debug for ContainerOpenedEvent
Source§impl Event for ContainerOpenedEvent
impl Event for ContainerOpenedEvent
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 ContainerOpenedEvent
impl EventRouting for ContainerOpenedEvent
Auto Trait Implementations§
impl Freeze for ContainerOpenedEvent
impl RefUnwindSafe for ContainerOpenedEvent
impl Send for ContainerOpenedEvent
impl Sync for ContainerOpenedEvent
impl Unpin for ContainerOpenedEvent
impl UnsafeUnpin for ContainerOpenedEvent
impl UnwindSafe for ContainerOpenedEvent
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