Skip to content

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.player Extends: 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.

FieldTypeAccessorMutableNullable
playerRefRef<EntityStore>getPlayerRef()NoNo
playerPlayergetPlayer()NoNo
craftedRecipeCraftingRecipegetCraftedRecipe()NoNo
quantityintgetQuantity()NoNo
  • 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.
  • CraftingManager.craft() (line 194) via eventBus dispatchFor — EventBus dispatch after crafting (deprecated, replaced by CraftRecipeEvent).
// DEPRECATED -- use CraftRecipeEvent (ECS event) for new code
getEventRegistry().register(PlayerCraftEvent.class, event -> {
Player player = event.getPlayer();
CraftingRecipe recipe = event.getCraftedRecipe();
int quantity = event.getQuantity();
// Example: log crafting activity
logCraft(player, recipe, quantity);
});

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.