diff --git a/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java b/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java index 818c4841e..d3466b5d7 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java @@ -300,14 +300,21 @@ public class NpcManager extends MiniPlugin { LivingEntity entity = (LivingEntity) _creature.SpawnEntity(npc.getLocation(), EntityType.valueOf(npc.getDatabaseRecord().getEntityType())); - entity.setCustomNameVisible(true); - String name = npc.getDatabaseRecord().getName() == null ? "" : npc.getDatabaseRecord().getName(); - for (ChatColor color : ChatColor.values()) - name = name.replace("(" + color.name().toLowerCase() + ")", color.toString()); + if (npc.getDatabaseRecord().getName() == null) + { + entity.setCustomNameVisible(false); + entity.setCustomName(ChatColor.RESET.toString()); + } + else + { + String name = npc.getDatabaseRecord().getName(); + for (ChatColor color : ChatColor.values()) + name = name.replace("(" + color.name().toLowerCase() + ")", color.toString()); + name = ChatColor.translateAlternateColorCodes('&', name); - name = ChatColor.translateAlternateColorCodes('&', name); - - entity.setCustomName(ChatColor.RESET + name); + entity.setCustomNameVisible(true); + entity.setCustomName(ChatColor.RESET + name); + } entity.setCanPickupItems(false); entity.setRemoveWhenFarAway(false);