pub struct CraftingPreCraftEvent {
pub result: Slot,
pub is_shift_click: bool,
pub cancelled: bool,
}Expand description
A player is about to take a crafting result (cancellable).
Fired at the Validate stage on the game bus when a player clicks the crafting output slot — both for normal clicks and the initial click of a shift-click batch. Cancelling the event aborts the craft entirely (no consumption, no result transfer).
For shift-click batches, CraftingShiftClickBatchEvent fires
immediately after this event (if not cancelled here) to allow
plugins to cap the batch size.
The crafting player is available via ctx.player().
Fields§
§result: SlotThe result the player is about to receive.
is_shift_click: boolWhether the player shift-clicked (batch craft).
cancelled: boolWhether this event has been cancelled by a Validate handler.
Trait Implementations§
Source§impl Clone for CraftingPreCraftEvent
impl Clone for CraftingPreCraftEvent
Source§fn clone(&self) -> CraftingPreCraftEvent
fn clone(&self) -> CraftingPreCraftEvent
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 CraftingPreCraftEvent
impl Debug for CraftingPreCraftEvent
Source§impl Event for CraftingPreCraftEvent
impl Event for CraftingPreCraftEvent
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 CraftingPreCraftEvent
impl EventRouting for CraftingPreCraftEvent
Auto Trait Implementations§
impl Freeze for CraftingPreCraftEvent
impl RefUnwindSafe for CraftingPreCraftEvent
impl Send for CraftingPreCraftEvent
impl Sync for CraftingPreCraftEvent
impl Unpin for CraftingPreCraftEvent
impl UnsafeUnpin for CraftingPreCraftEvent
impl UnwindSafe for CraftingPreCraftEvent
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