The term of art used in MS Code Section 97-29-101 which is probably what is being referred to in the OP, is "obscene" (not offensive or erotic, which are frequently not legally "obscene").
This term is defined in such a restrictive manner by First Amendment case law that it is almost impossible to prevail on a charge like this in the fact of any remotely competent attorney defending the case, unless it involves child pornography. The currently controlling definition under the federal First Amendment is from the U.S. Supreme Court case Miller v. California (1973), which held that:
materials were obscene if they appealed, "to a prurient interest",
showed "patently offensive sexual conduct" that was specifically
defined by a state obscenity law, and "lacked serious artistic,
literary, political, or scientific value." Decisions regarding whether
material was obscene should be based on local, not national,
In practice, the "lacked serious artistic, literary, political, or scientific value" portion of the definition is usually what defeats these prosecutions as a matter of law.
Some of the most relevant case law is summarized here.
Is it true that it's illegal (in mississippi I think) in some states
to write 'offensive' erotic fiction? Regardless of whether or not it's
published or meant for public consumption.
This is definitely not true. The offense in Mississippi is distributing obscene fiction, not writing it. Any ban on writing it without distributing it would definitely be unconstitutional.