-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set Username #267
Comments
You may be able to change the username property on the player by running player.username = "name"; |
ok I will try that :) |
"Username of the person who ran an command" I'm not sure what you mean by that. When should the username be changed ? |
Imagine someone types "/nick" in the Chat. My plugin should be triggerd and the name/nick of this Person should change for others. So I need a was to change the property username of the person who ran the command "/nick" |
Ok here is how you can add such a command #126 (comment) serv._writeAll('player_info',{
action: 3,
data: [{
UUID: player._client.uuid,
displayName: "new_display_name"
}]
}); |
Yeah I think that is what I searched for :) thanks |
Also: wouldn't it be better if the chat lib uses instead of the Username the displayName or do I mix something up there? |
here is an example to create a command https://github.com/PrismarineJS/flying-squid/blob/master/doc/API.md#playercommands What do you mean by chat lib ? I'm not sure where the display name should be used, but yeah maybe we should use it at some places. Do tell if you find places where the display name make more sense than the username ;) |
I mean the Name that is showed before an chat message :) There could maybe the DisplayName make sense. |
Does the vanilla server do it ? |
From Bukkit (Spigot Code GIT): https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse/src/main/java/org/bukkit/entity/Player.java#44 (I reference Bukkit because Bukkit also does have Nick plugins and the vanilla one doesn't) There says the inline Documentation (at least i understand it in that way), that the Display Name is used in the Chat. |
Ah. I see. So the actual username of the player is retained, but the display name is changed. 👍 this should be fixed as to not cause future player data saving errors based off of username when people change the username instead of display name. |
Hi is there an way to change the Username of the person who ran an command? Like an auto nick? (I only search the function to set the Username. The Rest am I working on)
The text was updated successfully, but these errors were encountered: