Plants can’t feel pain. They don’t have a mind or nervous system. But, even if that weren’t true, a vegan diet would still be required.
You need to feed animals. Veganism removes this, thus, more efficiently growing calories.
Resulting in less harm than a non-vegan diet even if plants could feel.