Skip to content

PlayerCreativeSlotEvent

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

public ref struct PlayerCreativeSlotEvent : IEvent

A creative-mode player put a stack into an inventory slot from the creative menu (slot -1: threw one out of the menu). Cancel to refuse; the client is resynced.

Id 129
Key mc:player_creative_slot
Cancellable yes
Fired by the engine yes
Field Type Handlers may write Description
Player player no (readonly) The player.
Slot int no (readonly) The menu slot (1-45), or -1 for a drop.
Item item no (readonly) The stack the client wants.

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

Member Description
PlayerCreativeSlotEvent(Player player, int slot, ItemView item) Creates the event (for firing it from a plugin; native code builds its own).
public PlayerCreativeSlotEvent(Player player, int slot, ItemView item)

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
slot int
item ItemView
Member Description
bool Cancelled { get; set; } Cancelling stops lower-priority handlers (unless they opt in) and the action itself.
ItemView Item { get; } The stack the client wants.
Player Player { get; } The player.
int Slot { get; } The menu slot (1-45), or -1 for a drop.
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 Item { get; }

The stack the client wants.

public Player Player { get; }

The player.

public int Slot { get; }

The menu slot (1-45), or -1 for a drop.

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.

IEvent · ItemView · Player