When an Itemstack is shift clicked from the crafting table result slot, a copy of that itemstack is created and placed in the player's inventory, as opposed to the Itemstack stored in the ItemCraftedEvent. This causes changes to the itemstack to be ignored when the player shift clicks, but the changes are applied if the player simply left click. In the following example, any PickAxeItem crafted by the player will be maximally damaged when the player left clicks the item to pick it up. But if the player shift clicks the item, it is moved to the inventory without damaging it. I have been scratching my head for a while on how to get around this. Any ideas?
@SubscribeEvent
public void onPickaxeCraft(ItemCraftedEvent craftedEvent){
ItemStack craftedItemStack = craftedEvent.getCrafting().getStack();
if(craftedItemStack.isEmpty() || !(craftedItemStack.getItem() instanceof PickaxeItem)) return;
craftedItemStack.setDamage(craftedItemStack.getMaxDamage());
}