[SPIGOT-252] Change Player Nametag Created: 20/Dec/14  Updated: 21/Dec/14  Resolved: 21/Dec/14

Status: Closed
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Minor
Reporter: Alexander S. Assignee: Thinkofname
Resolution: Won't Fix Votes: 0
Labels: 1.8, entity


 Description   

I'm currently working on a Minecraft Network, I tried to give youtubers and staff members the ability to change their nickname. (Player Tag)
I tried to do this with packets but that didnt worked. So now I'm here!
There are .setCustomName(); and .setCustomNameVisible(); maybe make them also work for players, this would be pretty helpful.



 Comments   
Comment by Ali Moghnieh [ 21/Dec/14 ]

Technically you can using reflection. But you don't need to, you can intercept packets as they pass through using something like ProtocolLib.

Comment by Alexander S. [ 21/Dec/14 ]

Thanks, but thats not my problem...
You need to destroy and create a player by using packets, but you cant set the GameProfile of the EntityHuman to the new GameProfile (with new name) because it's final.
So you can't update his GameProfile

Comment by Ali Moghnieh [ 21/Dec/14 ]

Have a look at this: https://github.com/lenis0012/NPCFactory/blob/master/src/main/java/com/lenis0012/bukkit/npc/NPCProfile.java

Comment by Alexander S. [ 21/Dec/14 ]

I know, but in 1.8 you can't modify the name in the GameProfile because it's final...

Comment by Ali Moghnieh [ 21/Dec/14 ]

What is the player tag? The player nametag above their head? You can't change that unless you destroy the entity, and send a packet with the same exact data but change the name (this used to work when i tested it with 1.7, not sure if it works with 1.8). You might need to update the player info (<tab> list), but don't quote me on that.

P.S. setCustomName() doesn't work on players as the client force renders the GameProfile's name.

Comment by Thinkofname [ 21/Dec/14 ]

Mojang have already broken this once (but reverted due to other issues) and I wouldn't put it past them to try again

Comment by SpigotMC [ 20/Dec/14 ]

Your build is not the latest and therefor may be the reason you are having this issue. Spigot is 1400 version(s) behind. CraftBukkit is 0 version(s) behind. This message was automatically generated and is not guaranteed to be a solution to your issue.

Generated at Mon Apr 21 21:19:18 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.