@Override
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer player, EnumHand handIn) {
ItemStack stack = player.getHeldItemMainhand();
damageTrinketInHand(stack, player);
if (stack.isEmpty()) {
stack = new ItemStack(ModItems.BROKEN_TRINKET);
}
return new ActionResult<>(EnumActionResult.SUCCESS, stack);
}
private void damageTrinketInHand(ItemStack stack, EntityLivingBase entityLiving) {
stack.damageItem(1, entityLiving);
}