This is tricky but necessary. I mean you could if you didn’t want to confront your friend, attend the events and not have to give a reason. However if your friend asks I would be honest with them. Sometimes you must have a difficult discussion. There is no way around your friend’s bad attitude.
Keep in mind that your friend is mostly aware of their bad attitude. Your friend may even disguise it with this is how I am take it or leave it type talk. People always find ways around accepting their behavior and doing something about it. You may not win your friend over by telling them about something they may not want to accept. However I wouldn’t invite them to events until they actually did. Your friend is going to say you changed or you’re stuck up but remember end of day you don’t want to spend the night having to defend your friend’s attitude and behavior. No one wants that. You want to go and enjoy yourself. If your friend is being awful to others because “that’s how it is” they can be that way at home.
You also don’t have to necessarily cut your friend off but keep in mind but having the conversation might tip it that way. Listen people with bad attitudes aren’t oblivious to how they are often times they don’t care. You can make up valid reasons of pain and past traumas and they all could be valid. However what’s not valid is knowing those triggers exist and expecting to be in a world where we should just deal with embarrassing behavior just because. Tell your friend the truth. Expect them to be mad. In time when they are ready to accept responsibility which also means change, you and your friend can hang out in public events without everyone around you having to be put off by your friend’s bad attitude.
As always good luck. Don’t back down because your friend will say that if you are my friend you should understand them. It’s not okay and accountability is important! Speak up and good luck!