PrepareCraftEvent
Namespace Mc.Scripting.Events · Kind struct (ref)
public ref struct PrepareCraftEvent : IEventThe crafting grid matched a recipe. Cancel to show no result.
| Id | 265 |
| Key | mc:prepare_craft |
| Cancellable | yes |
| 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 result that would be shown. |
Set e.Cancelled = true in a handler to cancel it; lower-priority handlers are skipped unless they subscribed with receiveCancelled: true.
Constructors
Section titled “Constructors”| Member | Description |
|---|---|
PrepareCraftEvent(Player player, Utf8String recipe, ItemView result) |
Creates the event (for firing it from a plugin; native code builds its own). |
Constructor
Section titled “Constructor”public PrepareCraftEvent(Player player, Utf8String recipe, ItemView result)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 |
Properties
Section titled “Properties”| Member | Description |
|---|---|
bool Cancelled { get; set; } |
Cancelling stops lower-priority handlers (unless they opt in) and the action itself. |
Player Player { get; } |
The player. |
Utf8String Recipe { get; } |
Recipe id. |
ItemView Result { get; } |
The result that would be shown. |
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. |
Cancelled
Section titled “Cancelled”public bool Cancelled { get; set; }Cancelling stops lower-priority handlers (unless they opt in) and the action itself.
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 result that would be shown.
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