eclipseisoffline / customname

This mod adds a /name command to Minecraft, which players can use to set a prefix, suffix, or nickname.
GNU Lesser General Public License v3.0
2 stars 1 forks source link

[FEATURE] Allow server admins to modify other players Prefix, Suffix and name #4

Open fibberclip opened 2 hours ago

fibberclip commented 2 hours ago

Is your feature request related to a problem? Please describe. In a way. I wanted to use this mod to personally edit player's prefixes and suffixes to give players badges, flags & stuff on my personal server

Describe the solution you'd like, or the feature you want to see implemented It'd be sick if server admins were able to set other player's prefix, suffix and potentially nicknames too, as well as just an option in the config to block players from editing their own stuff. This would make it so much easier to manually set a player's badges on their suffix without having to make a new team for them.

Describe alternatives you've considered The workaround i've been using is teams, however it's very tedious, since if i wanna give Player 1 badge A, B and C but player 2 only badge C, i have to make entirely new teams for each player.

Additional context My server has a custom font to display country flags and badges on the player's name (such as supporter, player, admin, etc) and while it's a pretty straight-forward system, creating a new team for every single player that needs more than 1 very specific badge is tiring.

eclipseisoffline commented 2 hours ago

Hi, modifying other players names is possible by making use of the vanilla /execute as command, which makes that player execute the given command. For example, this command would set the nickname of the player "Steve" to "NotSteve":

/execute as Steve run name nickname NotSteve

Additionally, you can prevent players from changing prefixes/nicknames/suffixes by not giving them the customname.prefix, customname.nick or customname.suffix permissions respectively. Make sure you have require_permissions set to true in the configuration file.

You can use a permission manager like LuckPerms to manage player permissions. A full description of the mod's permissions can be found in the README. Also, note that LuckPerms can also set prefixes/suffixes, which this mod supports reading from. More on that can be read in LuckPerms Meta Commands wiki page.

I will consider adding support to change other player's names using just the /name command as it has been requested before, I'll keep you updated on this.

fibberclip commented 2 hours ago

Oooh, i see! I did try running the /execute command but it showed as red and didn't go through... I can't recall if the mod was installed on the server only, though, maybe that was the issue? i'll try again tomorrow when players are on the server, thank you!

I mentioned the config option since i've personally had a lot of performance issues with LuckPerms on my server, just adding it tanks the tps a lot, i'll give it another shot, but a simple config option to allow only ops to run commands (off by default, imo) would be a life saver 🙏 tysm for such a quick reply!

eclipseisoffline commented 2 hours ago

Hm, odd that the /execute command showed as red, as the mod should only have to be installed server-side. Make sure that the normal /name command outside of /execute works, and verify that you entered /execute correctly (/execute as <player> run name <options>).

If you have require_permissions set to true (which it is by default), then only operators or players with said permissions can use the /name command. Since you don't use a permission manager, that should mean only operators can use the command.

Hopefully this helps, if you have any further issues, feel free to let me know!

fibberclip commented 1 hour ago

Yeah, the normal name command works fine outside of that, but when i try to run it inside execute it shows as red. Execute itself works ofc, but trying to do "/execute as [player] run" then name doesn't show up... I'll run proper tests tomorrow since i can't access the server rn, but when i did try it didn't allow me

That's perfect then, all i need ^^ thank you! I'll tweak the configs tomorrow too, thanks a lot!!

eclipseisoffline commented 1 hour ago

Sounds good, you're welcome! If you're still having issues with /execute, feel free to get back to me here so I can look into it.