Skip to content

Commit

Permalink
Fix spectral name tag cascading
Browse files Browse the repository at this point in the history
  • Loading branch information
ACGaming committed Dec 28, 2024
1 parent e4dfe9d commit bf9b1bb
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ public static void spawnSpectralEntity(World world, @Nullable EntityLivingBase e
if (entity != null && isWhitelistedMob(entity))
{
entity.getEntityData().setBoolean("IsSpectral", true);
entity.setCustomNameTag("Spectral " + entity.getName());
if (!entity.getName().startsWith("Spectral"))
{
entity.setCustomNameTag(entity.hasCustomName() ? "Spectral " + entity.getCustomNameTag() : "Spectral " + entity.getName());
}
entity.setHealth(entity.getMaxHealth());
entity.deathTime = 0;
entity.isDead = false;
Expand Down

0 comments on commit bf9b1bb

Please sign in to comment.