diff --git a/main/src/main/java/net/citizensnpcs/npc/CitizensNPC.java b/main/src/main/java/net/citizensnpcs/npc/CitizensNPC.java index b456055f3..6a5daf5f2 100644 --- a/main/src/main/java/net/citizensnpcs/npc/CitizensNPC.java +++ b/main/src/main/java/net/citizensnpcs/npc/CitizensNPC.java @@ -327,6 +327,7 @@ public class CitizensNPC extends AbstractNPC { } updateFlyableState(); + updateCustomNameVisibility(); updateCustomName(); Messaging.debug("Spawned", getId(), "SpawnReason." + reason); @@ -381,11 +382,7 @@ public class CitizensNPC extends AbstractNPC { updateCounter = 0; } - String nameplateVisible = data(). get(NPC.NAMEPLATE_VISIBLE_METADATA, true).toString(); - if (requiresNameHologram()) { - nameplateVisible = "false"; - } - getEntity().setCustomNameVisible(Boolean.parseBoolean(nameplateVisible)); + updateCustomNameVisibility(); if (isLiving) { NMS.setKnockbackResistance((LivingEntity) getEntity(), @@ -406,6 +403,14 @@ public class CitizensNPC extends AbstractNPC { } } + private void updateCustomNameVisibility() { + String nameplateVisible = data(). get(NPC.NAMEPLATE_VISIBLE_METADATA, true).toString(); + if (requiresNameHologram()) { + nameplateVisible = "false"; + } + getEntity().setCustomNameVisible(Boolean.parseBoolean(nameplateVisible)); + } + private void updateCustomName() { boolean nameVisibility = false; if (!getEntity().isCustomNameVisible()