設定 Sponge

This article is about configuring Sponge itself; plugins will usually create their own configuration files inside the server 「config」 directory. For Vanilla configuration check out the Minecraft Wiki.

Sponge 設定檔案

Sponge has multiple configuration files, which all can be found in the config/sponge/ directory of your server:

  • tracker.conf
  • custom_data.conf
  • global.confworlds 資料夾中對應各維度與世界的子設定

The global.conf file contains the global configuration settings for Sponge. Its properties can be also overridden for each world and dimension type by using the config files in the subfolders of config/worlds.

The tracker.conf can be used to configure the Phase Tracker, and the custom_data.conf is used to manage custom data added by plugins.

使用文字編輯器修改設定

Open the desired file using your preferred editor. Sponge configuration files use HOCON format, which you can read more about in the 「Introduction to HOCON」.

After making your desired changes, save your file. If your server was running while you made changes, you must reload the config file using the reload commands explained below. For example, after making changes to your global.conf, run /sponge reload -g to reload the global configurations from file.

覆蓋全域設定

If you would like to override the global configs in just a single world or dimension type, for example raise the spawn cap of monsters in the Vanilla Nether alone, subconfigs allow you to do just that. You can find configs for every world and dimension on your server within the worlds folder, inside the main Sponge config folder. These are sorted first by mods, and then dimension type. Simply modify those configs to your needs, and the changes will be applied to all the related worlds, overriding broader configs. This follows a simple order: World > Dimension > Global

使用指令修改設定

It is possible to modify most configs through the in-game command /sponge config. The syntax for the config command looks like this:

/sponge config <flag> <key> <value>

There are the following flags for specifying the target that you would wish to change.

  • -g 是全域的旗標(global.conf
  • -d <維度> 目標是一個維度(dimension.conf
  • -w <世界> 目標是一個世界(world.conf
  • -t is the flag for tracker (tracker.conf)

<name> being a placeholder, you need replace with the name of your target, e.g. -d minecraft:nether.

The key is the value you want to change. The value is whatever you want to change the value of the key to. For example, if you want to change chunk-load to true in the file config/sponge/minecraft/nether/dimension.conf:

sponge {
    logging {
        # Log when chunks are loaded
        chunk-load=false
    }
}

這是你應該使用的指令:

/sponge config -d minecraft:nether logging.chunk-load true

If you need to check the value of a key, simply omit the value. Checking the value of a key such as logging.chunk-load in the nether can be done like so:

/sponge config -d minecraft:nether logging.chunk-load

儲存設定

Saving a world config to the file may be desired after making modifications. This can be useful in the event of an unexpected server crash. This is done by using the /sponge save command on the server. The syntax for this command is similar to the config command:

/sponge save <flag>

下面是一個儲存全域設定檔的範例:

/sponge save -g

重新載入設定

Sometimes you need to reload a world config while the server is still running. This is useful when you have made changes to the local config file, and want to reload it for use on the live server. This is made possible by the command /sponge reload. The syntax for the command is as follows:

/sponge reload <flag>

這是重新讀取終界設定檔的一個範例:

/sponge reload -d minecraft:the_end