1.15.2 better custom name visible option

Discussion in 'Spigot Plugin Development' started by lokka30, Mar 14, 2020.

  1. Hi, I've received many feature requests on my plugin LevelledMobs about a nametag feature which I will explain below.

    Currently, Minecraft has a 'custom name visible' option on entities. when set to true, their nametags can be seen from within render distance, or when set to false, only when looking at them from 3 or 4 blocks away.
    The problem with custom-name-visible = true is that mobs names can be seen even when you can't see them (e.g. you are above ground, and the mob is in a cave).
    The problem with custom-name-visible = false is that you have to be pissing distance from the entity you want to check the name of.
    This is a problem especially with my plugin, where mobs get far quicker movement speed and stronger attack damages. You'll end up with low health just to check the mob's tag with custom-name-visible false. With it set to true you will see a ton of monster tags below you.

    So, my question is:
    Is there a way to let players view mobs nametags only if they can see the entity? (i.e. an in-between value for true and false)

    I have already looked a little into this, and I can only think of solutions which would cause a lot of lag.

    Thanks everyone
  2. You could update the visibility on EntityTargetEvent to show it while the mob has a target.
    • Like Like x 1
  3. That's a pretty good idea, thanks