Seeing an Entities custom name from a distance.

Discussion in 'Plugin Development' started by NullChips, Mar 25, 2017.

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

    NullChips

    Hi,

    I'm currently trying to get a Zombie with a custom display name to show it's name tag from a distance, like it would with a player - at the moment it only shows the name tag when the player is within a few blocks of the entities location. I'm assuming this is possible as I've seen it done on countless servers before. And yes, I have used .setCustomNameVisible(true); but from my experience as well as looking through the documentation, all that appears to do is set the custom name to be visible only when the player is close to the entity.

    Thanks
     
  2. I dont exactly understand what you are trying to do: but .setCustomNameVisible(true); should work.
    What it does is that it shows the nametag, wether the player is looking at the entity or not.
    You would it like this.
    Code:
    Zombie z = loc.getWorld().spawnEntity(loc, EntityType.ZOMBIE);
    z.setCustomName("Your message goes here");
    z.setCustomNameVisible(true);
    
     
  3. Offline

    NullChips

    That's exactly what I'm doing, but it doesn't seem to work. The name tag is still only visible when I'm in a close proximity with, and looking at the entity. Might this be a client-side issue?
     
  4. Offline

    Drkmaster83

    Pretty sure that this is a client-limitation. I believe it's somewhere around 12-16 blocks that the nametag unrenders. Primarily, the reason I can think that this is existent is because nametag "holograms" became prevalent in 1.6 or so, with ArmorStands and WitherSkulls being invisible, which caused a lot of lag to the client, and yeah.
     
  5. Offline

    NullChips

    Any idea of a workaround? I've seen it done elsewhere.
     
  6. Offline

    raunak114

    Maybe summon invis armor stands in the direction of the zombie (in between the player and the zombie)
     
Thread Status:
Not open for further replies.

Share This Page