How could I make it so when a player chats, it as a space above their name in txt, and under it?

Discussion in 'Plugin Development' started by PerezHD, Dec 20, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    PerezHD

    Basically, I am trying to make my messages more out their for others to view better. I need some help on spacing them.

    For example:
    " "
    PerezHD: 'msg'
    " "

    Can someone help me, if you do not understand, please let me know!
     
  2. Offline

    API_Tutorials

    @PerezHD
    Code:
    @EventHandler(priority = EventPriority.HIGHEST)
    public void asyncPlayerChat(AsyncPlayerChatEvent e){
    
    e.setFormat("\n" + e.getFormat() + "\n");
    
    }
    should do the trick
     
  3. Offline

    WesJD

    @PerezHD AsyncPlayerChatEvent#setFormat
     
  4. Offline

    PerezHD

    It works fine for the top of the users text, but it doesn't do it for the buttom ?!
     
  5. Offline

    mine-care

    @PerezHD then broadcast a empty message to add the empty line :3
     
  6. Offline

    PerezHD

    Oh I see :)

    Nope, it just adds a line above the users name, not under it XD

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 29, 2016
  7. Offline

    API_Tutorials

    @PerezHD
    add a §r after the second \n
     
  8. Offline

    PerezHD

    Idk if I even did it right? But it still isn't working :/

    Code:
          @EventHandler(priority = EventPriority.HIGHEST)
          public void asyncPlayerChat(AsyncPlayerChatEvent e){
              Player p = e.getPlayer();
              if (p.hasPermission("flexutils.space.chat")){
                  e.setFormat("\n" + e.getFormat() + "\n" + "§r");
              }
          }
     
  9. Offline

    mine-care

    @PerezHD Alternatively you can:
    broadcast: a empty line, then the format, then a empty line
     
Thread Status:
Not open for further replies.

Share This Page