Program: 174680
Project: 174680
Buggy source:
@SubscribeEvent(priority=EventPriority.HIGHEST) public void onLivingHurt(LivingHurtEvent event){
  if (event.getSource().getTrueSource() instanceof EntityPlayer && !event.getSource().getTrueSource().getEntityWorld().isRemote) {
    EntityPlayer player=(EntityPlayer)event.getSource().getTrueSource();
    ItemStack stack=player.inventory.getCurrentItem();
    if (stack != null && stack.getItem() instanceof ItemSword && !(stack.getItem() instanceof ItemMHSAdvancedMelee)) {
      NBTTagCompound nbt=NBTHelper.loadStackNBT(stack);
      double trueDamage=Math.random() * (nbt.getInteger("String_Node_Str") - nbt.getInteger("String_Node_Str")) + nbt.getInteger("String_Node_Str");
      event.setAmount((float)trueDamage);
    }
  }
  if (event.getEntityLiving() instanceof EntityPlayer && (event.getSource().getTrueSource() instanceof EntityLivingBase || event.getSource() == ModDamageSources.FROST || event.getSource() == ModDamageSources.LIGHTNING || event.getSource() == ModDamageSources.POISON)) {
    EntityPlayer player=(EntityPlayer)event.getEntityLiving();
    for (    ItemStack stack : player.inventory.armorInventory) {
      NBTTagCompound nbt=NBTHelper.loadStackNBT(stack);
      if (event.getSource().getTrueSource() instanceof EntityLivingBase) {
      }
 else {
        if (ArmorAttribute.FROST_RESIST.hasAttribute(nbt) && event.getSource() == ModDamageSources.FROST)         event.setAmount((float)(event.getAmount() * ArmorAttribute.FROST_RESIST.getAmount(nbt)));
        if (ArmorAttribute.LIGHTNING_RESIST.hasAttribute(nbt) && event.getSource() == ModDamageSources.LIGHTNING)         event.setAmount((float)(event.getAmount() * ArmorAttribute.LIGHTNING_RESIST.getAmount(nbt)));
        if (ArmorAttribute.POISON_RESIST.hasAttribute(nbt) && event.getSource() == ModDamageSources.POISON)         event.setAmount((float)(event.getAmount() * ArmorAttribute.POISON_RESIST.getAmount(nbt)));
      }
      if (ArmorAttribute.DURABLE.hasAttribute(nbt) && Math.random() < ArmorAttribute.DURABLE.getAmount(nbt))       stack.setItemDamage(stack.getItemDamage() + 1);
    }
  }
}

Fixed version (ground truth):
@SubscribeEvent(priority=EventPriority.HIGHEST) public void onLivingHurt(LivingHurtEvent event){
  if (event.getSource().getTrueSource() instanceof EntityPlayer && !event.getSource().getTrueSource().getEntityWorld().isRemote) {
    EntityPlayer player=(EntityPlayer)event.getSource().getTrueSource();
    ItemStack stack=player.inventory.getCurrentItem();
    if (stack != null && stack.getItem() instanceof ItemSword && !(stack.getItem() instanceof ItemMHSAdvancedMelee)) {
      NBTTagCompound nbt=NBTHelper.loadStackNBT(stack);
      double trueDamage=Math.random() * (nbt.getInteger("String_Node_Str") - nbt.getInteger("String_Node_Str")) + nbt.getInteger("String_Node_Str");
      event.setAmount((float)trueDamage);
    }
  }
  if (event.getEntityLiving() instanceof EntityPlayer && (event.getSource().getTrueSource() instanceof EntityLivingBase || event.getSource() == ModDamageSources.FROST || event.getSource() == ModDamageSources.LIGHTNING || event.getSource() == ModDamageSources.POISON)) {
    EntityPlayer player=(EntityPlayer)event.getEntityLiving();
    for (    ItemStack stack : player.inventory.armorInventory) {
      NBTTagCompound nbt=NBTHelper.loadStackNBT(stack);
      if (event.getSource().getTrueSource() instanceof EntityLivingBase) {
      }
 else {
        if (ArmorAttribute.FROST_RESIST.hasAttribute(nbt) && event.getSource() == ModDamageSources.FROST)         event.setAmount((float)(event.getAmount() - (event.getAmount() * ArmorAttribute.FROST_RESIST.getAmount(nbt))));
        if (ArmorAttribute.LIGHTNING_RESIST.hasAttribute(nbt) && event.getSource() == ModDamageSources.LIGHTNING)         event.setAmount((float)(event.getAmount() - (event.getAmount() * ArmorAttribute.LIGHTNING_RESIST.getAmount(nbt))));
        if (ArmorAttribute.POISON_RESIST.hasAttribute(nbt) && event.getSource() == ModDamageSources.POISON)         event.setAmount((float)(event.getAmount() - (event.getAmount() * ArmorAttribute.POISON_RESIST.getAmount(nbt))));
      }
      if (ArmorAttribute.DURABLE.hasAttribute(nbt) && Math.random() < ArmorAttribute.DURABLE.getAmount(nbt))       stack.setItemDamage(stack.getItemDamage() + 1);
    }
  }
}