Solved Remove <> encasing from names.

Discussion in 'Plugin Development' started by MCJoshua345, Aug 3, 2015.

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

    MCJoshua345

    Hey guys, so I've been developing a FFA PvP plugin that resembles a Survival Games plugin, and I ran into a problem. You know when you chat in singeplayer or something your name is encased in these symbols : <>. I've seen on other servers that they removed those symbols. How do they do that, and how can I?
    Thanks, xXInfinityXx (Formerly known as MCJoshua345)
     
  2. @MCJoshua345 This is your chat plugin, usually EssentialsChat. Just edit the config to remove them.
     
  3. Offline

    MCJoshua345

    The problem is that in the plugin I'm making custom name ranks, and I want to make that in my own plugin. Or is that too complicated and I should go with EssentialsChat (which I really don't want to do.)
     
  4. @MCJoshua345 You can do it in your plugin, just set the format with the AsyncPlayerChatEvent
     
    Shortninja66 and Googlelover1234 like this.
  5. Offline

    MCJoshua345

    Excuse me for being an absolute idiot but I have no idea what you just said. What modifications should I make to my event:
    Code:
    @EventHandler
        public void playerChat(AsyncPlayerChatEvent e) {
            Player p = e.getPlayer();
            String pname = p.getName();
           
            if(p.hasPermission("FFA.Mod")){
                String mod = "" + ChatColor.BLACK + "[" + ChatColor.WHITE + ChatColor.BOLD + "Siren" + ChatColor.BLACK + "] " + ChatColor.RESET + ChatColor.GOLD + pname + ChatColor.RESET + "";
                p.setDisplayName(mod);
            }else if(p.hasPermission("FFA.Builder")){
                String builder = "" + ChatColor.BLACK + "[" + ChatColor.GREEN + ChatColor.BOLD + "Cyclops" + ChatColor.BLACK + "] " + ChatColor.GOLD + pname + ChatColor.RESET + "";
                p.setDisplayName(builder);
            }else if(p.hasPermission("FFA.Admin")){
                String admin = "" + ChatColor.BLACK + "[" + ChatColor.DARK_RED + ChatColor.BOLD + "Minor God" + ChatColor.RESET + ChatColor.BLACK + "] " + ChatColor.GOLD +  pname + ChatColor.RESET + "";
                p.setDisplayName(admin);
            }else if(p.hasPermission("FFA.CoOwner")){
                String coowner = "" + ChatColor.BLACK + "[" + ChatColor.AQUA + ChatColor.BOLD + "TRITON" + ChatColor.RESET + ChatColor.BLACK + "] " + ChatColor.BLACK + "[" + ChatColor.DARK_GREEN + ChatColor.BOLD + "Elder Cyclop" + ChatColor.RESET + ChatColor.BLACK + "] " + ChatColor.GOLD + ChatColor.BOLD + pname + ChatColor.RESET + "";
                p.setDisplayName(coowner);
            }else if(p.hasPermission("FFA.Owner")){
                String owner = "" + ChatColor.BLACK + "[" + ChatColor.DARK_BLUE + ChatColor.BOLD + "POSEIDON" + ChatColor.RESET + ChatColor.BLACK + "] " + ChatColor.BLACK + "[" + ChatColor.GREEN + ChatColor.BOLD + "Cyclop" + ChatColor.BLACK +  "] " + ChatColor.GOLD + ChatColor.BOLD + pname + ChatColor.RESET + "";
                p.setDisplayName(owner);
            }else{
                String player = "" + ChatColor.BLACK + "[" + ChatColor.GREEN + pname + ChatColor.BLACK + "] " + ChatColor.RESET;
                p.setDisplayName(player);
            }
     
  6. Offline

    Googlelover1234

    @MCJoshua345
    Code:
    e.setFormat(String format);
    That will completely change the format of the message, so you can do, for example,

    Code:
    e.setFormat("I am a prefix! " + p.getName() + " " + e.getMessage()); 
     
    Shortninja66 and bwfcwalshy like this.
  7. Offline

    MCJoshua345

    Thank you so much!
    @bwfcwalshy
    Thank you, too.
    Setting thread as solved.
     
  8. Offline

    Evaluations

    You should set their display names when they join, not every time they chat.
     
    Shortninja66 likes this.
Thread Status:
Not open for further replies.

Share This Page