Skip to content

CraftItemEvent

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

public ref struct CraftItemEvent : IEvent

A player took the result of a crafting recipe (cancel the InventoryClick event of the result slot to prevent crafting).

Id 264
Key mc:craft_item
Cancellable no
Fired by the engine yes
Field Type Handlers may write Description
Player player no (readonly) The player.
Recipe Utf8String no (readonly) Recipe id.
Result item no (readonly) The crafted item.
ShiftClick bool no (readonly) Whether it is a quick-craft.
Member Description
CraftItemEvent(Player player, Utf8String recipe, ItemView result, bool shiftClick) Creates the event (for firing it from a plugin; native code builds its own).
public CraftItemEvent(Player player, Utf8String recipe, ItemView result, bool shiftClick)

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
recipe Utf8String
result ItemView
shiftClick bool
Member Description
Player Player { get; } The player.
Utf8String Recipe { get; } Recipe id.
ItemView Result { get; } The crafted item.
bool ShiftClick { get; } Whether it is a quick-craft.
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 Player Player { get; }

The player.

public Utf8String Recipe { get; }

Recipe id.

public ItemView Result { get; }

The crafted item.

public bool ShiftClick { get; }

Whether it is a quick-craft.

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 · Utf8String