$ and % throw errors when written

Discussion in 'Plugin Development' started by omnee, Jul 13, 2014.

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

    omnee

    Using the AsyncPlayerChatEvent setFormat() I get a console error whenever I type $ or %.
    The output message of when I type $ or % is just unformatted vanilla minecraft chat.
    Do I need to escape them in some way?
     
  2. Offline

    TheMcScavenger

  3. Offline

    1Rogue

    You need to conform to printf's standards
     
  4. Offline

    omnee

    I am using AsyncPlayerChatEvent correctly.

    I'll look into this.

    Not sure if I'm doing this correctly.
    % $ and \ are the characters giving the error as they're used in things such as %s.
    Replacing % with %% and \ with \\ seems to fix that for both sending the correct characters (% and \). However, $$ seems to give the exact same error. Am I doing anything wrong or is there an easier way of fixing this?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
Thread Status:
Not open for further replies.

Share This Page