Default Game Mode

Discussion in 'Plugin Development' started by MrCreeper, Sep 24, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    MrCreeper

    Hey :)
    How can I get the default game mode with a server instance? The default game mode is set in the server.properties.
     
  2. Offline

    Jogy34

    Bukkit.getServer().getDefaultGameMode();
     
  3. Offline

    MrCreeper

    Ah, I must have overlooked that. =D
    And how could I get the MOTD?
     
  4. MotD is plugin based.
     
  5. Offline

    MrCreeper

    I mean the motd property in the server.properties. This MotD gets displayed at the server list of minercraft clients.

    My solution:
    Code:java
    1. try {
    2. BufferedInputStream stream = new BufferedInputStream(new FileInputStream("server.properties"));
    3. prop.load(stream);
    4. stream.close();
    5. } catch (FileNotFoundException e2) {
    6. e2.printStackTrace();
    7. } catch (IOException e1) {
    8. e1.printStackTrace();
    9. }
    10. prop.getProperty("motd");
    11.  


    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 20, 2016
Thread Status:
Not open for further replies.

Share This Page