I'm writing an absurdist story where nearly every second line is a joke. I have an idea for a minor character, who is introduced like this: Mr. Yoda was the Japanese man down the hall, who, by coincidence, was short, green, and had a funny way of speaking English. (Nobody knew why he was short.) That part's fine. It's this part I'm wondering if I should include: "Herro dell," said Mr. Yoda in a racist, stereotypical Asian accent. (I must apologize for that; I have no idea what a Japanese accent sounds like.) And, later... "I'm sorry, but it's a little hard to understand you," said Bart apologetically. "Das okay. Brame lacist authull," Mr. Yoda waved. Will people get the wrong idea from this joke or will they understand that I am pretending to be completely uninformed about how Japanese people talk for the sake of humor? I'm probably overthinking it...
I think they'll understand fine that you're joking, though many won't find the humor in it. I don't find it offensive but I'm also not laughing. It's a little too easy, you know? And I know you didn't ask, but... This is a bit on the nose. You convey as much with "herro." You've already shown, so no reason to tell. And because words matter, this joke is "stereotypical." Not racist.
Yeah, this. Ethnic jokes are classic but accent jokes are low hanging fruit. The key to humor is to hit it on the offbeat instead of the downbeat. It's all in the delivery, which can be difficult in prose. It's a different story live or on TV. Katt Williams could read my shopping list and have everyone in stitches.
What joke? It's just plain old lampshading. It's been done to death and wasn't all that funny to begin with. Forget being racist (and it is, obviously) it's just a tired old pony that needed to be put down about a decade ago.
This is funny: The rest goes astray. I agree the accent is an old joke and not interesting. In the above you have the contrast that jokes are made of: no one knew why he was short, ignoring the obvious, why is he green. Where's the joke in the accent? Can you define it? Blame the racist author? Does this piece break the 4th wall? If that's where the joke lies, you may want to rethink it a bit.
The joke was that the narration itself acknowledged the accent was racist. In a movie, a Japanese character might have a stereotypical accent, but in a book this wouldn't happen-- that's the joke.
It's actually been done quite a lot in books, so much so that most writing guides advise against doing it these days. Take Terry Pratchett's The Wee Free Men as a rare example where it's done to great comedic effect. Mostly though, it falls flat.
I guess I have to compare what you're asking with a highly acclaimed film from 1960. It is Breakfast at Tiffany's and Mickey Rooney plays a Japanese landlord named Mr. Yunioshi. Notice his exaggerated buck teeth and his exaggerated mannerisms in general. I think most people today would find this as pretty racist. Now as far as doing this in a book though, maybe the best way is to see this from your protagonist's standpoint. Perhaps you can somehow point out your protagonist may be a little racist himself. In other words, he perceives that Japanese person in an exaggerated way and you don't mean the character is in fact that way in reality (maybe he hears lacist when he really is saying racist, something like that).
Well, the way I meant it is that the character actually IS a stereotype due to gross misrepresentation, but the fourth wall is broken in the joke, acknowledging that if the character were a real Japanese person their mannerisms would not be so stereotypical (and he probably wouldn't be short, either. That's just weird. I can't think of any human, Japanese or otherwise, who is naturally short.) Because this is a book, the author has no idea what a Japanese person is like, and turns him into a caricature. I'm not sure anymore that the joke really works. I'll just stick with the Yoda joke.
The fact that he's introduced as Yoda is hilarious but nothing more than that. I mean if you want to do the joke right try watching the anime hetalia. That's how you make fun of accents in my opinion.