I don't want to use anti inflammatory when having dysmenorrhea because its bad for the liver. How can I prevent dysmennorhea?

Many options. I agree with Dr. Beard.NSAID’s, SSRI’s, hormone meds, OTC meds containing diuretics, warm bath, heating pad, exercise & acupuncture are excellent for dysmenorrhea. Avoid caffeine, chocolate, alcohol & salt. Get GYN eval to R/O underlying pathology. Consider omega- 3 fatty acids, magnesium (supplementation or through diet) or Black Cohosh with dr ok. Sipping Chamomile can dissipate pain.