occurs when a characters words mean, the opposite of their literal meaning

This is called verbal irony. It is a literary device that is often used to create humor or sarcasm in the text, but can also be used to show the character's true feelings or intentions. For example, when a person says "Great, just what I needed" in a sarcastic tone after receiving bad news, the meaning of the words contradicts the tone and reveals the true feelings of the character.