Deserializing chat?

Discussion in 'Spigot Plugin Development' started by kangarko, Jul 12, 2015.

  1. Hello,

    as of Minecraft 1.7.2 every chat message is a chat component. I am catching the chat packet and I would like to deserialize the json/chat component into one string. Is it possible?
    #1 kangarko, Jul 12, 2015
    Last edited: Jul 12, 2015
  2. ChatSerializer.a() from nms?
    • Like Like x 1
  3. Thank you so much! I noticed those methods but I thought it is something inside ChatDeserializer instead :D
  4. When I did ChatSerializer.a(theJsonText).c() (also, the c() method in IChatBaseComponent class), all colours from the message were removed. Is it possible to convert it to legacy message with & or § color codes?
  5. idk but why do you need that??
  6. I have a plugin that has a feature of editing packet messages, but currently it is limited to the parts of the json (it means that you can only edit a part of message with same color).

    Nevermind, I found a suitable solution in ComponentSerializer and TextComponent :)
    Thanks for help