John-Paul-R / Essential-Commands

Configurable, permissions-backed utility commands for Fabric servers (tpa, home, warp, spawn, back, nick, rtp)
MIT License
108 stars 34 forks source link

Command auto-complete suggests nicknames, but only accepts full usernames #216

Open John-Paul-R opened 1 year ago

John-Paul-R commented 1 year ago

either revert the "enhancement" of suggesting nicknames, or make it toggleable and make it work

John-Paul-R commented 1 year ago

In modern day, I believe what is happening here is that the MC client uses the same information it has about player names for the PlayerList for the Brigadier autocomplete. Since EC provides PlayerList names... oboy.

John-Paul-R commented 1 year ago

The serverside solution to this is to accept nicknames when parsing the command argument. (since the autocomplete is done clientside, and we do need to replace those name values in the PlayerList)

To do it right, this'll require enforcing that nicknames be unique. Ideally, it would be impossible to create a nickname that has a text value that matches an existing Minecraft username, but we can't do that because it defeats the purpose. Maybe we just check against the players already registered on the server... but there is always the possibility that someone sets their nickname to "Tom", then the real "Tom" joins the server. -- We could namespace both nicknames and realnames with a character that is invalid for MC usernames. That might work. Makes entering names normally more annoying, though.

John-Paul-R commented 1 year ago

incidentally, I assume this is caused by one of nickname_above_head,nicknames_in_player_list being enabled.

lexi-the-cute commented 10 months ago

it's nickname_above_head that's causing the issue