That's really hard to code. You have to convert player's skin to image, then cut head. After that you must copy-paste the head on to prepared map. Then you sent the map data to player. Maybe there's some library which can help you making the text.