#[non_exhaustive]pub enum Click {
Pickup {
slot: i16,
right: bool,
},
QuickMove {
slot: i16,
right: bool,
},
Swap {
slot: i16,
hotbar: u8,
},
Drop {
slot: i16,
all: bool,
},
PickupAll {
slot: i16,
},
Clone {
slot: i16,
},
QuickCraft {
slot: i16,
stage: DragStage,
kind: DragKind,
},
}Expand description
A click intent: the vanilla GUI gestures a bot needs. Slot numbers are the open screen’s
(window 0 when only the player inventory is open); OUTSIDE (-999) is a click outside the
window.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Pickup
Mode 0: left click (right = false: pick up / put down / swap the whole stack) or right
click (pick up half / put down one). On OUTSIDE it drops the cursor stack (left) or
one item of it (right).
QuickMove
Mode 1: shift-click (move the stack to the other part of the window).
Swap
Mode 2: number key over a slot: swap it with hotbar slot hotbar (0..=8), or on 1.16.5
40 (the swap-hands key) with the offhand.
Drop
Mode 4: drop key over a slot (all = false: one item, Q; all = true: the stack,
ctrl+Q). With an empty cursor and OUTSIDE this is what the vanilla GUI sends for a
click outside the window (no effect).
PickupAll
Mode 6: double click: gather items like the cursor stack into it.
Clone
Mode 3: middle click in creative mode: a full stack of the slot’s item onto the empty cursor (26.1; no effect outside creative mode).
QuickCraft
Mode 5: one packet of a drag (“quick craft”): the GUI sends DragStage::Start (slot
OUTSIDE), one DragStage::Slot per slot the mouse crosses, then
DragStage::End (slot OUTSIDE), each its own click (26.1).