EssentialsX

EssentialsX

2M Downloads

Ability to change player name above head

Jadiction opened this issue ยท 19 comments

commented

Currently, Essentials provides the ability to change your display name and with that name change, you can have it show in chat and even in the tab list (scoreboard) as well as the prefix, which is great.

The last step to fully modifying a player's identity (and always showing their prefix aka rank) is to add the ability to add the prefix to their nametag above their head (and even show their nickname instead).

I'm aware other plugins can do this, but usually they become abandoned and provide all of the features above when Essentials does 2 / 3 features and it'd make sense to not require another plugin to modify 1 last name feature (and it seems simple enough to implement as well). The fewer plugins, the better and I plan to keep Essentials, so this would be great.

Would be much appreciated, thanks for reading!

commented

Here to add a thought to this whole thread. Since 1.19.4, There are now new display entity types including Text Display entities. This makes me think that maybe in a future EssentialsX update (maybe even its own addon plugin), There could be a way to change the name above players heads by hiding the actual player name and then using a text display entity to display the username. With this, you could modify the player name to be anything which would work with both nicknames and prefixes with permission plugins. Just a thought.

commented

Here to add a thought to this whole thread. Since 1.19.4, There are now new display entity types including Text Display entities. This makes me think that maybe in a future EssentialsX update (maybe even its own addon plugin), There could be a way to change the name above players heads by hiding the actual player name and then using a text display entity to display the username. With this, you could modify the player name to be anything which would work with both nicknames and prefixes with permission plugins. Just a thought.

Using display entities to manage fake name tags is still outside of the scope for Essentials. While the results that are achievable using them are fairly impressive, it is still a hacky solution which is better suited to existing standalone as its own plugin.

I think it is fair to say that Essentials will ever add this feature unless a safer alternative exists; ideally proper API for directly setting a player name tag.

commented

Not aware of this being possible. Can you give examples of these "other plugins" you're describing?

commented

For more information, there's an option to:

  1. Add the role prefix to chat via Essentials
  2. Add the role prefix to tab list via Essentials

My suggestion is to add a prefix for nametags to fully complete using Essentials to customize someone's name.

commented

Thanks, for now I'll mark this as "open to PR". As long as it can be cleanly implemented, I think this is a very reasonable addition. Definitely makes sense given the other options available for displaying the user's name.

commented

This used to be possible with the original Essentials several years ago, but from what I recall it was removed for some vague issue to do with the tab list (or the API might have just changed).

commented

I feel like I recall it as well, but maybe it is like the recipe issue. I think it's worth keeping this open though until someone confirms that this does work or not.

One easy thing to look into would be: are the suggested plugins above compatible with Essentials? If open source, do they use the Bukkit API or NMS? I can't look into it right now but if anyone checks into that it would be helpful to know.

commented

@pop4959 The above plugins are compatible with Essentials, I've used both. Haven't looked at their source code though.

commented

Sweet, good to know. Next step will be to take a deeper look. Essentials is not a plugin that tends to break significantly from version to version (1.13 aside, as it pretty much broke any plugin that dealt with blocks -- which is most of them). This is due to low usage of NMS code. I think this has a pretty good likelihood of being (re?)added if it only uses API. We'll see though, I don't personally have the time to look into this further for now. It is open to PR though, so anyone can come along and check it out.

commented

Considering writing a PR, would really like this for my server. New-ish to plugin dev & haven't worked with Essentials codebase before tho, any advice?

commented

Considering writing a PR, would really like this for my server. New-ish to plugin dev & haven't worked with Essentials codebase before tho, any advice?

Do some research first, such as:

  • Is this possible in the Bukkit API? Perhaps investigate into the example plugins given above, if they are open source.
  • Does the API support versions 1.8.8-1.16.1?
  • Any potential history or leftover code from when Essentials (might) have had this feature in the past.
  • How feasible is the addition? What is the scope of the change?

Once you have some answers for that (and anything else I may have missed that was mentioned above), then you can suggest something and we can give you some advice. :)

commented

Thank you for that wonderful response! I'll take a look and get back to this soon.

commented

I don't think this will be a good fit for Essentials, teams are a very painful thing to maintain and I don't envy the plugins that handle them, let alone maintain compatibility between 1.8-1.16

commented

I don't think this will be a good fit for Essentials, teams are a very painful thing to maintain and I don't envy the plugins that handle them, let alone maintain compatibility between 1.8-1.16
@JRoy

But this is not about "teams"? The nickname that essentials allow players to change is not showing as their nametag. This was a feature of the old essentials.

Current behaviour is that changing {PLAYER} has no effect on the nametag, {USERNAME} being used instead.
This issue is about replacing the nametag with the contents of {PLAYER}, and optionally adding the prefix and suffixes from the groups to that.

The tablist already does this, only the nametag remains untouched.

commented

@0x5c Can you tell us what version of Essentials has this feature and how you set it up? I've used Essentials for a long time but I have no recollection of this ever existing, although MD claims that it was. Would be helpful to see what the behavior was in the code back then.

This issue has been open to PR for well over a year but it doesn't seem like anyone has had any interest in doing further research on it, and if that remains the case I don't see a problem with it being closed. If you mean to say that you've taken an interest and would like to try to tackle this yourself, by all means, we will re-open it for you.

I think @JRoy's point was that a lot of plugins get around this in a fairly hacky way by manipulating scoreboard teams. This is not a solution we would be interested in pursuing with Essentials as it can cause a variety of problems on servers.

commented

@0x5c In the past, Bukkit allowed changing the name tag as the server and game's design allowed for this, but this has changed in the past several years. The only means to change the player name tag at present using API involves creating a scoreboard team, adding prefixes/suffixes to the team, then adding players to the team. It's doable, but this would interfere with any vanilla or plugin usage of scoreboard teams. The alternative is to hack around NMS to change the username known to the server, but this would risk breaking anything that uses usernames at all (plugins, skins, commands). As @pop4959 says, there isn't a sane way to do this on modern versions of Minecraft.

commented

Ha, scoreboard teams
I see the problem now, yeah doesn't sound in scope for essentialx
Thanks for explaining in more details

commented

To answer about when this was possible, 8~9 years ago
I'm surprised how much of essentials is still mostly the same as back then