#[non_exhaustive]pub struct ClickPacket {
pub window_id: u8,
pub slot: i16,
pub button: u8,
pub mode: u8,
pub action: i16,
pub item: Option<Stack>,
pub swings: u8,
}Expand description
A window click as sent (window_click; 1.8 ClickWindowC2SPacket).
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.window_id: u8Window id (0 = player inventory).
slot: i16Slot, or -999.
Mouse button / hotbar key.
mode: u8Click mode.
action: i16Action number: the window’s counter, incremented before each click.
item: Option<Stack>What vanilla’s onSlotClick returned (the server compares it with its own result).
swings: u81.16.5: arm swings (main hand) to send before the click: the client’s
PlayerEntity.dropItem swings for each stack the click drops (a throw, a click
outside with a carried stack); 0 on the other versions.
Implementations§
Source§impl ClickPacket
impl ClickPacket
Sourcepub fn to_v1_8(&self) -> WindowClick
pub fn to_v1_8(&self) -> WindowClick
The 1.8 window_click.
Sourcepub fn to_v1_12_2(&self) -> WindowClick
pub fn to_v1_12_2(&self) -> WindowClick
The 1.12.2 window_click.
Sourcepub fn to_v1_16_5(&self) -> WindowClick
pub fn to_v1_16_5(&self) -> WindowClick
The 1.16.5 window_click.
Trait Implementations§
Source§impl Clone for ClickPacket
impl Clone for ClickPacket
Source§impl Debug for ClickPacket
impl Debug for ClickPacket
impl Eq for ClickPacket
Source§impl PartialEq for ClickPacket
impl PartialEq for ClickPacket
impl StructuralPartialEq for ClickPacket
Auto Trait Implementations§
impl !Freeze for ClickPacket
impl Forget for ClickPacket
impl Move for ClickPacket
impl RefUnwindSafe for ClickPacket
impl Send for ClickPacket
impl Sync for ClickPacket
impl Unpin for ClickPacket
impl UnsafeUnpin for ClickPacketwhere
*const u8: UnsafeUnpin,
Align8<*mut ()>: UnsafeUnpin,
&'static Vtable: UnsafeUnpin,
*const ComponentPatch is !null: UnsafeUnpin,
PhantomData<ComponentPatch>: UnsafeUnpin,
impl UnwindSafe for ClickPacketwhere
*const u8: UnwindSafe,
Align8<*mut ()>: UnwindSafe,
&'static Vtable: UnwindSafe,
BoxRaw<ComponentPatch>: UnwindSafe,
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