Plugin category: Command Suggested name: GamemodeReset What I want: A simple command that sets every players' game mode. Both online and offline players. Ideas for commands: /resetgm - Resets everyone's game mode to the default mode according to server.properties /setall creative|survival - Sets everyone's game mode to Creative or Survival Ideas for permissions: player.canreset - Determines whether or not the player has the ability to use /resetgm player.cansetall - Gives access to /setall command When I'd like it by: As soon as possible. We've already had 1 incident where a player was giving away items.
Mine will do precisely what he asked and I need the practice Besides, this sounds like for loopy fun-ness
Almost done, bro, just fixing bugs Done! Here are the links: Download: http://minespaceserver.org/trentpublic/Plugins/GamemodeReset/1.0/GamemodeReset.jar Source: http://minespaceserver.org/trentpublic/Plugins/GamemodeReset/1.0/src.zip I need to add the feature for offline players... Working on it. EDIT: hmm, can't seem to figure it out :/ EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Sorry. I was out to dinner with my girlfriend. Thanks for the effort so far. Hopefully you can figure it out. If not, it's okay. Thanks for trying at least.
For the offline player part you could wait until the player joins and set their gamemode then, or edit the offline player's file, in which case you may find this useful - http://forums.bukkit.org/threads/lib-tut-improved-offline-player-nbt-editing-made-easy.92627/.
I tried the PlayerJoinEvent method, but it doesn't seem to want to work. I'll try that link Thanks A TON one4me! You're awesome ^.^ Thanks for the class, it's very useful. I don't need to use it for this, though. I can just make a list of the offline players and get their player status with the getPlayer() method. Must have read over that >.<. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Why not just set the player's gamemode when they log in? For example, if the user types /setall survival, then when a player logs in, set them to survival. The only thing you have to store is the current mode (you can just write it to the config). EDIT: Just read one4me's post. I'd definitely go with the first option -- It'll be easier to code and will require a lot less data storage.
It's almost done, I'm just finalizing bug fixes with multiple players Sorry, I can't seem to get it to work with offline players. I have the final copy here: Download: http://minespaceserver.org/trentpublic/Plugins/GamemodeReset/2.2/GamemodeReset.jar Source Code: http://minespaceserver.org/trentpublic/Plugins/GamemodeReset/2.2/src.zip EDIT by Moderator: merged posts, please use the edit button instead of double posting.
The getPlayer() method returns null when the Player is not online, so you can't set the gamemode like that. And I put this plugin together. VanillaExtract Just use /gamemode <gamemode> everyone to set everyone's gamemode (including offlineplayers) You can type default, d, or -1 for it to set the default gamemode.