diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java index a0b78447..b4e49c6f 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java @@ -380,7 +380,13 @@ public abstract class Disguise { } if (isDynamicName()) { - String name = getEntity().getCustomName(); + String name; + + if (getEntity() instanceof Player) { + name = DisguiseUtilities.translateAlternateColorCodes(DisguiseUtilities.getDisplayName(getEntity())); + } else { + name = getEntity().getCustomName(); + } if (name == null) { name = ""; @@ -1014,8 +1020,14 @@ public abstract class Disguise { setExpires(DisguiseConfig.isDynamicExpiry() ? 240 * 20 : System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(330)); } - if (isDynamicName() && !isPlayerDisguise()) { - String name = getEntity().getCustomName(); + if (isDynamicName()) { + String name; + + if (getEntity() instanceof Player) { + name = DisguiseUtilities.translateAlternateColorCodes(DisguiseUtilities.getDisplayName(getEntity())); + } else { + name = getEntity().getCustomName(); + } if (name == null) { name = ""; diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java index d7ce862f..ab2b2a99 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java @@ -648,7 +648,13 @@ public class PlayerDisguise extends TargetedDisguise { } if (isDynamicName()) { - String name = getEntity().getCustomName(); + String name; + + if (getEntity() instanceof Player) { + name = DisguiseUtilities.translateAlternateColorCodes(DisguiseUtilities.getDisplayName(getEntity())); + } else { + name = getEntity().getCustomName(); + } if (name == null) { name = "";