Development Assistance Chat format element repeating

Discussion in 'Plugin Help/Development/Requests' started by sniddunc, Mar 3, 2016.

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

    sniddunc

    Hello,

    I am trying to display a String before the format but I don't want to modify the formats applied by other plugins. What I am doing is event.setFormat(extra_element + event.getFormat());.

    This is my listener:

    PHP:
    public class PlayerChatListener implements Listener {
      
        @
    EventHandler
        
    public void onPlayerChat(AsyncPlayerChatEvent event) {
          
            
    Player player event.getPlayer();
          
            
    event.setFormat(ChatColor.GREEN Players.getRepString(player) + event.getFormat());  
        }
    }
    What happens is that when I talk in chat, it displays the string, but it displays it twice right against itself. I have tried many different ways to get a different result, but no matter what I do it inserts the number twice instead of once.

    Thank you for any help.
     
Thread Status:
Not open for further replies.

Share This Page