Essential Commands

Essential Commands

108k Downloads

Allow /nickname clear to use the @a selector

Swizzler121 opened this issue ยท 7 comments

commented

I run a community center minecraft server, we use essential commands, and they're super helpful, especially the nickname command, as it lets players set their own name on the provided shared accounts for that session, however after the end, I have to manually go in and clear each nickname, if there was a way to reset all nicknames (logged in or not) from the server, this would save a ton of time. I'm thinking just adding the @A selector to the possible targets of clear would work. Currently this results in an error saying only one target can be selected, but for clear it should be fine to select everything.

commented

Hi! It's awesome to hear how you're using EC.

Curiosity: would it be beneficial to clear all player data (homes, /back location, etc.) in addition to nicknames for this "clear" command?

commented

yes, as I can't control who is at the station the next week, I try to get it back to a neutral position as I can, also reduces the chance of two regulars fighting over one station.

edit: removed the bit about the command not working on logged out users, didn't realize I already mentioned that.

commented

Here is a dev version that adds a command /deleteAllPlayerData, which

  1. can only be used by players with OP 4
  2. will immediately kick all connected players
  3. will delete the Essential Commands player data of all players (deleting the files on disk)
  4. must be enabled in the config/EssentialCommands.properties file (look for enable_delete_all_player_data)

https://github.com/John-Paul-R/Essential-Commands/actions/runs/6372430539
^ Inspect the "artifacts" file here

commented

be warned, this clears all information EC has about all players, permanently. So homes, nicknames, /back locations, etc. will be removed.

commented

thanks, I'll be able to test it in a day or so and report back.

commented

Sorry it's been more than "a day or so" I wanted to wait until after the next two minecraft sessions once I realized i'd need to update to 1.20.2 to test, and now that I have upgraded the clients are really struggling to launch, so i'm troubleshooting that now. I'll report back if I get stuff launching and can test. Currently cutting out mods until I get things to launch.

commented

Okay I got enough clients running to test. It worked (mostly) I ran it direct from the server console, it kicked everyone except for one player, not sure why they were excluded, but it did wipe out nicknames.

essentialcommands deleteAllPlayerData
[00:18:29] [Server thread/INFO]: Are you sure you want to disconnect all players and permanently delete ALL Essential Commands player data? This action is irreversible. Run the command again to confirm.
essentialcommands deleteAllPlayerData
[00:18:44] [Server thread/INFO]: splGamer2 lost connection: Server closed
[00:18:44] [Server thread/INFO]: splGamer2 left the game
[00:18:44] [Server thread/WARN]: handleDisconnection() called twice
[00:18:44] [Server thread/INFO]: splGamer4 lost connection: Server closed
[00:18:44] [Server thread/INFO]: splGamer4 left the game
[00:18:44] [Server thread/INFO]: splGamer7 lost connection: Server closed
[00:18:44] [Server thread/INFO]: ~sage 7 left the game
[00:18:44] [Server thread/INFO]: splGamer8 lost connection: Server closed
[00:18:44] [Server thread/INFO]: splGamer8 left the game
[00:18:45] [Server thread/INFO]: splMinecrafter lost connection: Server closed
[00:18:45] [Server thread/INFO]: splMinecrafter left the game

nothing in the log except possibly the [00:18:44] [Server thread/WARN]: handleDisconnection() called twice hints at why one player survived the "purge" but it worked otherwise. maybe a race condition?