Yea i have that from time to time mostly when i don’t ejaculate often. I try to masturbate everyday, i have not been able to because of my room mate situation, but if i go a week- two weeks with out ejaculating. I get this Jello like substance when i cum. The best way for me to describe it is it’s like tapioca pudding.
Just like clgp7 said stay hydrated, i also say have sex or masturbate every day if you can or every other day. I think this is cause by backed up sperm. Men are biologically made to GET OFF once a day, if not more than that. If it’s painful i would go see a doctor. but try the recommendations first.