Skip to content

InventoryDragEvent

Namespace Mc.Scripting.Events · Kind struct (ref)

public ref struct InventoryDragEvent : IEvent

A player finished dragging a stack over several slots. Cancel to undo.

Id 263
Key mc:inventory_drag
Cancellable yes
Fired by the engine yes
Field Type Handlers may write Description
Player player no (readonly) The player.
Kind enum:InventoryKind no (readonly) The container kind.
DragType enum:DragType no (readonly) The drag mode.
Slots NativeBytes no (readonly) The dragged slots as packed little-endian int32 values.
Cursor item no (readonly) The cursor stack being distributed.

Set e.Cancelled = true in a handler to cancel it; lower-priority handlers are skipped unless they subscribed with receiveCancelled: true.

Member Description
Constructor Creates the event (for firing it from a plugin; native code builds its own).
public InventoryDragEvent(Player player, InventoryKind kind, DragType dragType, NativeBytes slots, ItemView cursor)

Creates the event (for firing it from a plugin; native code builds its own). Signature of API 1.0.

Parameters

Name Type Description
player Player
kind InventoryKind
dragType DragType
slots NativeBytes
cursor ItemView
Member Description
bool Cancelled { get; set; } Cancelling stops lower-priority handlers (unless they opt in) and the action itself.
ItemView Cursor { get; } The cursor stack being distributed.
DragType DragType { get; } The drag mode.
InventoryKind Kind { get; } The container kind.
Player Player { get; } The player.
NativeBytes Slots { get; } The dragged slots as packed little-endian int32 values.
static ushort CatalogueId { get; } Catalogue id (stable ABI).
static bool IsCancellable { get; } Whether handlers can cancel the event.
static string Key { get; } Registry key of the event.
public bool Cancelled { get; set; }

Cancelling stops lower-priority handlers (unless they opt in) and the action itself.

public ItemView Cursor { get; }

The cursor stack being distributed.

public DragType DragType { get; }

The drag mode.

public InventoryKind Kind { get; }

The container kind.

public Player Player { get; }

The player.

public NativeBytes Slots { get; }

The dragged slots as packed little-endian int32 values.

public static ushort CatalogueId { get; }

Catalogue id (stable ABI).

public static bool IsCancellable { get; }

Whether handlers can cancel the event.

public static string Key { get; }

Registry key of the event.

DragType · IEvent · InventoryKind · ItemView · NativeBytes · Player