I have a galaxy s4 from AT&T with knox on it. And I just want to root (no custom roms) but if my phone breaks or something I don't want to void my warranty because it's rooted. So is my warranty voided automatically with root or is it voided only if the root is the cause of the problem.
Rooting your phone will void the warranty from both the carrier and the manufacturer.
No matter what happens to be wrong. If they found that the phone's rooted then you'll have to face the consequences.
*So your warranty will be void automatically with root. *
Your friends just got lucky. thats it. No manufacture in this world will provide you warranty services after you have rooted the device.