PlayerCraftEvent
DEPRECATED (forRemoval=true) — This event is deprecated and scheduled for removal. Use
CraftRecipeEvent(ECS event) instead.
Package:
com.hypixel.hytale.server.core.event.events.playerExtends:PlayerEvent<String>Implements:IEvent<String>Cancellable: No
Standard event dispatched after a player crafts an item. This event fires after the crafting operation has completed and cannot be cancelled. It has been replaced by the ECS-based CraftRecipeEvent which provides pre/post hooks and cancellation support.
Fields / Accessors
Section titled “Fields / Accessors”| Field | Type | Accessor | Mutable | Nullable |
|---|---|---|---|---|
playerRef | Ref<EntityStore> | getPlayerRef() | No | No |
player | Player | getPlayer() | No | No |
craftedRecipe | CraftingRecipe | getCraftedRecipe() | No | No |
quantity | int | getQuantity() | No | No |
- playerRef — ECS reference to the player entity. Inherited from
PlayerEvent. - player — The player who crafted the item. Inherited from
PlayerEvent. - craftedRecipe — The recipe that was crafted.
- quantity — The number of items produced by the crafting operation.
Fired By
Section titled “Fired By”CraftingManager.craft()(line 194) viaeventBus dispatchFor— EventBus dispatch after crafting (deprecated, replaced by CraftRecipeEvent).
Listening
Section titled “Listening”// DEPRECATED -- use CraftRecipeEvent (ECS event) for new codegetEventRegistry().register(PlayerCraftEvent.class, event -> { Player player = event.getPlayer(); CraftingRecipe recipe = event.getCraftedRecipe(); int quantity = event.getQuantity();
// Example: log crafting activity logCraft(player, recipe, quantity);});Migration
Section titled “Migration”Replace usage with the ECS-based CraftRecipeEvent:
// Old (deprecated, will be removed):getEventRegistry().register(PlayerCraftEvent.class, event -> { ... });
// New (preferred):// Register an EntityEventSystem<EntityStore, CraftRecipeEvent.Pre> instead.// See CraftRecipeEvent documentation for the ECS event handler pattern.Related Events
Section titled “Related Events”CraftRecipeEvent— The ECS-based replacement. Provides Pre/Post hooks and cancellation support.LivingEntityInventoryChangeEvent— Fires alongside this event when crafting modifies the player’s inventory.