CraftItemEvent
Namespace Mc.Scripting.Events · Kind struct (ref)
public ref struct CraftItemEvent : IEventA 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. |
Constructors
Section titled “Constructors”| 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). |
Constructor
Section titled “Constructor”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 |
Properties
Section titled “Properties”| 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. |
Player
Section titled “Player”public Player Player { get; }The player.
Recipe
Section titled “Recipe”public Utf8String Recipe { get; }Recipe id.
Result
Section titled “Result”public ItemView Result { get; }The crafted item.
ShiftClick
Section titled “ShiftClick”public bool ShiftClick { get; }Whether it is a quick-craft.
CatalogueId
Section titled “CatalogueId”public static ushort CatalogueId { get; }Catalogue id (stable ABI).
IsCancellable
Section titled “IsCancellable”public static bool IsCancellable { get; }Whether handlers can cancel the event.
public static string Key { get; }Registry key of the event.
See also
Section titled “See also”IEvent · ItemView · Player · Utf8String