Solved Chat Component API Multiline Tooltip

Discussion in 'Spigot Plugin Development' started by J3Kennard, Mar 20, 2017.

  1. Hi, I am currently using the Chat Component API to create some nice fancy JSON messages in chat, and I was wondering how I would create multiple lines of text in a tooltip when people hover over something.

    I have something like this,
    Code (Text):
    TextComponent message = new TextComponent("Test");
    message.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, tooltipComponents));
    where tooltipComponents is a TextComponent[], but for some reason all the individual items in tooltipComponents are put on the same line within the tooltip.

    Is there a way to make it so each item goes on a new line?
     
  2. Just use \n.
     
  3. Can't believe I didn't think of that lol. Thanks! Thread closed.
     

Share This Page