MC versions 1.19.1 and 1.19.2 added cryptographically verified chat messages which complicates things. I'm not sure what the API for this should look like.  (The above image might be out of date by now)