Solved Setting chat formats

Discussion in 'Plugin Development' started by мσмєит, Feb 21, 2017.

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

    мσмєит

    Hello! I've looked all over Bukkit, the JD for Bukkit, Spigot, etc. looking for a solution to this problem. I've used e.setFormat(<insert text here>); once before and it worked but for some odd reason this does not want to work whatsoever.

    Could you please help me?

    Here is my class.

    https://hastebin.com/sobebofefi.swift
     
  2. Offline

    BizarrePlatinum

    @мσмєит are you getting an error on startup? Or is it just not functioning how you desire?
     
  3. Online

    timtower Administrator Administrator Moderator

    @мσмєит Use %s twice instead of the username and message itself, then a different plugin can still modify the text that is being send.
    Did you register the event?
     
  4. Offline

    мσмєит

    @BizarrePlatinum Not functioning how I desire. There is no errors just not working.
    @timtower I will try that.

    (Editing this before it got moderated) %s did not work. Could you point me in the right direction for a different method?
     
    Last edited: Feb 22, 2017
  5. Online

    timtower Administrator Administrator Moderator

    @мσмєит A chat message should have %s twice in it.
    The first one gets replaced by the displayname, the second gets replaced by the message itself.
     
  6. Offline

    мσмєит

    I did do that but it's still showing up as the default <Name>
     
  7. Online

    timtower Administrator Administrator Moderator

    @мσмєит Add a final else statement to your list of if statements.
    Then you can change it if the user is not part of those groups.
     
  8. Offline

    мσмєит

    Okay will do, at school right now so I'll get back to you when I test it.

    Is this looking right? I believe I did what you said but it isn't working.

    https://hastebin.com/xayumuteho.swift

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Feb 22, 2017
    timtower likes this.
  9. Online

    timtower Administrator Administrator Moderator

    @мσмєит That is what I wanted to see indeed.
    Did you register the event?
     
  10. Offline

    мσмєит

    Oh my god.
     
Thread Status:
Not open for further replies.

Share This Page