Change everyone's game mode (Including offline players)

Discussion in 'Archived: Plugin Requests' started by FuzionZero, Sep 13, 2012.

  1. Offline

    FuzionZero

    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.
     
  2. Offline

    xEpicTaco

    I can do it :]
     
  3. Offline

    np98765

  4. Offline

    xEpicTaco

    Mine will do precisely what he asked and I need the practice :p

    Besides, this sounds like for loopy fun-ness :p
     
  5. Offline

    FuzionZero

    I noticed that plugin but it hasn't been updated in some time.

    Thanks! Can't wait.
     
  6. Offline

    xEpicTaco

    Last edited by a moderator: May 28, 2016
  7. Offline

    FuzionZero

    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.
     
  8. Offline

    one4me

  9. Offline

    xEpicTaco

    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.
     
    Last edited by a moderator: May 28, 2016
  10. Offline

    np98765

    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.
     
  11. Offline

    xEpicTaco

    Last edited by a moderator: May 28, 2016
  12. Offline

    one4me

    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.
     

Share This Page