Essentials ChangeDisplayName

Discussion in 'Plugin Development' started by Fight_Or_Die, Jul 20, 2014.

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

    Fight_Or_Die

    Hey,
    In a nickname sort of plugin I'm creating, I recently ran into an issue. While the line in the config for changing a users displayname is set to false (like this):
    change-displayname: false
    the plugin works fine, but it never shows the prefix once the displayname is changed by my nickname plugin.
    [​IMG]
    However, when I use:
    change-displayname: true
    the plugin doesn't change the color, but shows the prefix for the player.
    [​IMG]
    Any ideas?
    Regards,
    Fight

    EDIT: Changing OP color to 'none' in config.yml didn't work.

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

    FabeGabeMC

    Double false?
    Also, we can't help you if you can't show us what you've done in that section of your plugin.
    (Spotting errors).
    ~Gabe
     
  3. Offline

    Fight_Or_Die

    Fixed my post.
    All this command does is:

    Code:java
    1.  
    2. p.setDisplayName(cCustom + ChatColor.RESET);
    3.  
    4. p.sendMessage(prefix + " " + ChatColor.GRAY + "You set your nickname to: " + ChatColor.RESET + cCustom + ChatColor.GRAY + ".");
    5. return true;
    6.  


    Where cCustom the the argument.
     
  4. Offline

    Necrodoom

    I dont think 2 chat plugins can set the displayname to different things and have the result a combination of both.
    Also, essentials already has a /nick command?
     
  5. Offline

    Fight_Or_Die


    I'm not necessarily setting two separate nicknames/display-names, though. This command has more than just setting the display-name, but it wouldn't have anything to do with the formatting. Each plugin that updates a player's display-name overrides their current name and sets a new one.

    So really, I'm just trying to set this to a different color, but if I change it to true, it doesn't change the color & shows the prefix, however if I set it to false - it changes color but gets rid of the prefix.

    Is there an API I need to tie into for the ChatManager to function properly with this command?

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

    Necrodoom

    Fight_Or_Die You may not be setting 2 seperate display-names by yourself, but you and essentials does. Displayname contains prefix/suffix, and you override it with your own.

    If you are looking for an essentials specific hook, you can get the user object and then look at the nick methods.
     
    Fight_Or_Die likes this.
  7. Offline

    Fight_Or_Die

    If setting two display-names is an issue, what would you recommend as the best way to change a user's name and allowing prefixes to work properly?
    Necrodoom

    Necrodoom
    https://forums.bukkit.org/threads/s...-conflicts-with-essentialschat-or-pex.105087/

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

    Necrodoom

    Prefix is also part of displayname.. No matter how you take it, only one plugin will control displaynme.
     
Thread Status:
Not open for further replies.

Share This Page