Solved JSON Chat

Discussion in 'Spigot Plugin Development' started by Goofan, Jun 17, 2016.

  1. So I am following this:
    Trying to create events for chat however I'm getting an error on p.sendMessage(message);

    Following the Events paragraf...

    The method sendMessage(String) in the type CommandSender is not applicable for the arguments (TextComponent)
    Suggestions it points out does not work either:
    Change type of message to String...

    Now since I'm following the official tutorial by spigot on this I don't know where I went wrong :/

    Thanks in Advance,
  2. Try this. I haven't tested it:
    Code (Text):
    new TextComponent( "Hello world" ).getText()
  3. Choco


    • Winner Winner x 3
  4. That would return the text without formatting, the method the OP wants is toLegacyText()
    • Optimistic Optimistic x 1
    • Like Like x 1
  5. Thank you that worked :)
    I think they should update the tuturial I followed to add this
    • Agree Agree x 1
  6. It's a wiki, anyone can change it, just done a small addition to demo you can do it with spigot.
    • Like Like x 1
  7. Alright well I just changed the wiki then I hope noone minds :) If so feel free to revert my changes and add an explination to why it shouldn't be .spigot() there :)