Minecraft Wiki

除另有声明,转载时均必须注明出处若簡繁轉換出錯,請以遊戲內為準请勇于扩充与修正内容有兴趣逛逛我们的微博沟通交流,欢迎到社区专页需要协助,请在告示板留言

了解更多

Minecraft Wiki
Advertisement

Server

Java版預設的server.properties檔案

server.properties是儲存多人遊戲(Minecraft或Minecraft Classic)伺服器所有設定的檔案。

在編輯server.properties時,行之間的順序可以打亂,但檔案結構不能改變。每一行的等號之前的文字為變數名,你不應該修改這些內容。等號後面為變數的值,你可以按照規則自行編輯。以#開頭的行為注釋,加入、修改或移除注釋行不會對遊戲造成影響。

儲存了server.properties的變更之後,伺服器端必須重新啟動才能使變更生效,另一種選擇是在伺服器控制台或遊戲中使用/reload指令重新載入,這也能獲得同樣的效果。

如果server.properties檔案未列出下文中所有的屬性(例如伺服器端版本更新加入新屬性,或該檔案還未建立),那麼伺服器在啟動時會重寫server.properties補全缺失的屬性,並將缺失的屬性值設為預設值。

儘管有擴展名,server.properties檔案只是一個普通的UTF-8編碼文字檔案,因此可以使用任何文字編輯器進行編輯,比如Windows上的記事本、macOS上的TextEdit或者Linux上的nano和vim。

檔案位置[]

Java版[]

該檔案會在伺服器端第一次執行時自動生成(如果本來沒有的話)。

作業系統 檔案位置 註解
Windows 工作目錄路徑(chdir)
Linux

Unix Unix/Mac

工作目錄路徑(pwd)

如果你在你的 home 目錄下啟動(/home/用户名),伺服器端檔案也會在/home/用户名下建立。請按照下列步驟確保伺服器端檔案能夠如你預期地正確生成。

  • 準備一個完整的資料夾來存放所有伺服器端檔案。(如果你不這麼做的話事情會一團糟)
    • server.jar放置(複製、移動)進去。
  • 使用官方指導設定你的Minecraft伺服器端啟動腳本。(我們假設你的Minecraft伺服器端啟動腳本名是./start.sh
    • 確保它位於你的可執行目錄 $PATH
    • 確保你具有啟動腳本的執行權限(chmod +x start.sh,或使用資料夾管理器)
      • ./start.sh

基岩版[]

本檔案會與bedrock_server.exe一同下載。

作業系統 檔案位置
Windows bedrock_server.exe的相同目錄下
Linux bedrock_server的相同目錄下

server.properties[]

新安裝的Minecraft伺服器具有以下預設設定:

Java版[]

以下內容來自23w31a

#Minecraft server properties
#(文件修改时间戳)
enable-jmx-monitoring=false
rcon.port=25575
level-seed=
gamemode=survival
enable-command-block=false
enable-query=false
generator-settings={}
enforce-secure-profile=false
level-name=world
motd=A Minecraft Server
query.port=25565
pvp=true
generate-structures=true
max-chained-neighbor-updates=1000000
difficulty=easy
network-compression-threshold=256
max-tick-time=60000
require-resource-pack=false
use-native-transport=true
max-players=20
online-mode=false
enable-status=true
allow-flight=false
initial-disabled-packs=
broadcast-rcon-to-ops=true
view-distance=10
server-ip=
resource-pack-prompt=
allow-nether=true
server-port=25565
enable-rcon=false
sync-chunk-writes=true
op-permission-level=4
prevent-proxy-connections=false
hide-online-players=false
resource-pack=
entity-broadcast-range-percentage=100
simulation-distance=10
rcon.password=
player-idle-timeout=0
force-gamemode=false
rate-limit=0
hardcore=false
white-list=false
broadcast-console-to-ops=true
spawn-npcs=true
spawn-animals=true
log-ips=true
function-permission-level=2
initial-enabled-packs=vanilla
level-type=minecraft\:normal
text-filtering-config=
spawn-monsters=true
enforce-whitelist=false
spawn-protection=16
resource-pack-sha1=
max-world-size=29999984

基岩版[]

以下內容來自1.20.0.20

server-name=Dedicated Server
# Used as the server name
# Allowed values: Any string without semicolon symbol.

gamemode=survival
# Sets the game mode for new players.
# Allowed values: "survival", "creative", or "adventure"

force-gamemode=false
# force-gamemode=false (or force-gamemode is not defined in the server.properties)
# prevents the server from sending to the client gamemode values other
# than the gamemode value saved by the server during world creation
# even if those values are set in server.properties after world creation.
# 
# force-gamemode=true forces the server to send to the client gamemode values
# other than the gamemode value saved by the server during world creation
# if those values are set in server.properties after world creation.

difficulty=easy
# Sets the difficulty of the world.
# Allowed values: "peaceful", "easy", "normal", or "hard"

allow-cheats=false
# If true then cheats like commands can be used.
# Allowed values: "true" or "false"

max-players=10
# The maximum number of players that can play on the server.
# Allowed values: Any positive integer

online-mode=true
# If true then all connected players must be authenticated to Xbox Live.
# Clients connecting to remote (non-LAN) servers will always require Xbox Live authentication regardless of this setting.
# If the server accepts connections from the Internet, then it's highly recommended to enable online-mode.
# Allowed values: "true" or "false"

allow-list=false
# If true then all connected players must be listed in the separate allowlist.json file.
# Allowed values: "true" or "false"

server-port=19132
# Which IPv4 port the server should listen to.
# Allowed values: Integers in the range [1, 65535]

server-portv6=19133
# Which IPv6 port the server should listen to.
# Allowed values: Integers in the range [1, 65535]

enable-lan-visibility=true
# Listen and respond to clients that are looking for servers on the LAN. This will cause the server
# to bind to the default ports (19132, 19133) even when `server-port` and `server-portv6`
# have non-default values. Consider turning this off if LAN discovery is not desirable, or when
# running multiple servers on the same host may lead to port conflicts.
# Allowed values: "true" or "false"

view-distance=32
# The maximum allowed view distance in number of chunks.
# Allowed values: Positive integer equal to 5 or greater.

tick-distance=4
# The world will be ticked this many chunks away from any player.
# Allowed values: Integers in the range [4, 12]

player-idle-timeout=30
# After a player has idled for this many minutes they will be kicked. If set to 0 then players can idle indefinitely.
# Allowed values: Any non-negative integer.

max-threads=8
# Maximum number of threads the server will try to use. If set to 0 or removed then it will use as many as possible.
# Allowed values: Any positive integer.

level-name=Bedrock level
# Allowed values: Any string without semicolon symbol or symbols illegal for file name: /\n\r\t\f`?*\\<>|\":

level-seed=
# Use to randomize the world
# Allowed values: Any string

default-player-permission-level=member
# Permission level for new players joining for the first time.
# Allowed values: "visitor", "member", "operator"

texturepack-required=false
# Force clients to use texture packs in the current world
# Allowed values: "true" or "false"

content-log-file-enabled=false
# Enables logging content errors to a file
# Allowed values: "true" or "false"

compression-threshold=1
# Determines the smallest size of raw network payload to compress
# Allowed values: 0-65535

compression-algorithm=zlib
# Determines the compression algorithm to use for networking
# Allowed values: "zlib", "snappy"

server-authoritative-movement=server-auth
# Allowed values: "client-auth", "server-auth", "server-auth-with-rewind"
# Enables server authoritative movement. If "server-auth", the server will replay local user input on
# the server and send down corrections when the client's position doesn't match the server's.
# If "server-auth-with-rewind" is enabled and the server sends a correction, the clients will be instructed
# to rewind time back to the correction time, apply the correction, then replay all the player's inputs since then. This results in smoother and more frequent corrections.
# Corrections will only happen if correct-player-movement is set to true.

player-movement-score-threshold=20
# The number of incongruent time intervals needed before abnormal behavior is reported.
# Disabled by server-authoritative-movement.

player-movement-action-direction-threshold=0.85
# The amount that the player's attack direction and look direction can differ.
# Allowed values: Any value in the range of [0, 1] where 1 means that the
# direction of the players view and the direction the player is attacking
# must match exactly and a value of 0 means that the two directions can
# differ by up to and including 90 degrees.

player-movement-distance-threshold=0.3
# The difference between server and client positions that needs to be exceeded before abnormal behavior is detected.
# Disabled by server-authoritative-movement.

player-movement-duration-threshold-in-ms=500
# The duration of time the server and client positions can be out of sync (as defined by player-movement-distance-threshold)
# before the abnormal movement score is incremented. This value is defined in milliseconds.
# Disabled by server-authoritative-movement.

correct-player-movement=false
# If true, the client position will get corrected to the server position if the movement score exceeds the threshold.

server-authoritative-block-breaking=false
# If true, the server will compute block mining operations in sync with the client so it can verify that the client should be able to break blocks when it thinks it can.

chat-restriction=None
# Allowed values: "None", "Dropped", "Disabled"
# This represents the level of restriction applied to the chat for each player that joins the server.
# "None" is the default and represents regular free chat.
# "Dropped" means the chat messages are dropped and never sent to any client. Players receive a message to let them know the feature is disabled.
# "Disabled" means that unless the player is an operator, the chat UI does not even appear. No information is displayed to the player.

disable-player-interaction=false
# If true, the server will inform clients that they should ignore other players when interacting with the world. This is not server authoritative.

client-side-chunk-generation-enabled=true
# If true, the server will inform clients that they have the ability to generate visual level chunks outside of player interaction distances.

block-network-ids-are-hashes=true
# If true, the server will send hashed block network ID's instead of id's that start from 0 and go up.  These id's are stable and won't change regardless of other block changes.

disable-persona=false
# Internal Use Only

disable-custom-skins=false
# If true, disable players customized skins that were customized outside of the Minecraft store assets or in game assets.  This is used to disable possibly offensive custom skins players make.

server-build-radius-ratio=Disabled
# Allowed values: "Disabled" or any value in range [0.0, 1.0]
# If "Disabled" the server will dynamically calculate how much of the player's view it will generate, assigning the rest to the client to build.
# Otherwise from the overridden ratio tell the server how much of the player's view to generate, disregarding client hardware capability.
# Only valid if client-side-chunk-generation-enabled is enabled

Minecraft伺服器屬性[]

Java版[]

屬性 類型 預設值 描述
allow-flight 布林值 false 允許玩家在安裝加入飛行功能的mod前提下在生存模式下飛行

允許飛行可能會使惡意破壞者更加常見,因為此設定會使他們更容易達成目的。在創造模式下無作用。

false - 不允許飛行。懸空超過5秒的玩家會被踢出伺服器。
true - 允許飛行。玩家得以使用任何能飛行的mod飛行。
allow-nether 布林值 true 允許玩家進入地獄
false - 地獄傳送門不會生效。
true - 玩家可以透過地獄傳送門前往地獄。
broadcast-console-to-ops 布林值 true 向所有線上OP發送所執行指令的輸出。
broadcast-rcon-to-ops 布林值 true 向所有線上OP發送透過RCON執行的指令的輸出。
difficulty 字串 easy 定義伺服器的遊戲難易度(例如生物對玩家造成的傷害,飢餓和中毒對玩家的影響方式等)。

如果設定了舊的數字ID,則會自動轉化為英文的難易度名稱。

peaceful (0) - 和平
easy (1) - 簡單
normal (2) - 普通
hard (3) - 困難
enable-command-block 布林值 false 是否啟用指令方塊。
enable-jmx-monitoring 布林值 false 暴露一個具有對象名net.minecraft.server:type=ServerMBean和兩個屬性averageTickTimetickTimes用於暴露以毫秒為單位的tick時間。
為了啟用JRE的JMX,你需要加入在此處所述的一些JVM標誌。
enable-query 布林值 false 允許使用GameSpy4協議的伺服器監聽器。用於取得伺服器資訊。
enable-rcon 布林值 false 是否允許遠程訪問伺服器控制台。
  • 由於RCON協議傳輸資料時沒有加密,所以不建議把RCON暴露在互聯網上。RCON用戶端和伺服器端交換的所有資料(包括RCON密碼)都會泄露給正在監聽此連接的人。
enable-status 布林值 true 使伺服器在伺服器列表中看起來是「線上」的。
enforce-secure-profile 布林值 true 要求玩家必須具有Mojang簽名的公鑰才能進入伺服器。
true - 不具有Mojang簽名的公鑰的玩家不能進入伺服器。
false - 不具有Mojang簽名的公鑰的玩家也可進入伺服器。
enforce-whitelist 布林值 false 在伺服器上強制執行白名單。

當啟用後,不在白名單(前提是啟用)中的使用者將在伺服器重新載入白名單檔案後從伺服器踢出。

true - 不在白名單上的使用者會被踢出。
false - 不在白名單上的線上使用者不會被踢出。
entity-broadcast-range-percentage 整數(10-1000) 100 此選項控制實體需要距離玩家有多近才會將資料包發送給用戶端。更高的數值意味著實體可以在更遠的地方就被繪製,同時也可能提高增加延遲的機率。
這個值是以預設值的百分比來表示的。例如:將此值設為50,表示將繪製正常情況下一半距離以內的生物。
此功能模仿了用戶端顯示設定中的功能,而不像用戶端的顯示距離設定一樣只能在伺服器設定的限制下調整顯示距離。
force-gamemode 布林值 false 強制玩家加入時為預設遊戲模式
false - 玩家將以退出前的遊戲模式加入
true - 玩家總是以預設遊戲模式加入
function-permission-level 整數(1-4) 2 設定函數的預設權限等級。

4個等級的詳情見 #op-permission-level

gamemode 字串 survival 定義預設遊戲模式

如果值是舊用的數字,會靜默轉換為對應遊戲模式的英文名稱。

survival (0) - 生存模式
creative (1) - 創造模式
adventure (2) - 冒險模式
spectator (3) - 旁觀者模式
generate-structures 布林值 true 定義是否能生成結構(例如村莊)。
false - 新生成的區塊中將不包含結構。
true - 新生成的區塊中將包含結構。

註:由於地牢沙漠水井在技術上屬於地物,因而即使此項設為false,其仍然會生成。

generator-settings 字串 {} 本屬性質用於自訂世界的生成。詳見超平坦世界自訂了解正確的設定及例子。
hardcore 布林值 false 如果設為 true,伺服器難易度的設定會被忽略並且設為hard(困難),玩家在死後會自動切換至旁觀者模式。
hide-online-players 布林值 false 如果設為 true,伺服器端在響應用戶端狀態請求時不會返回線上玩家列表。
initial-disabled-packs 字串 空白 需要在建立世界過程中停用的資料包名稱,以逗號分隔。
initial-enabled-packs 字串 vanilla 需要在建立世界過程中啟用的資料包名稱,以逗號分隔。特別地,功能資料包必須在此指定才能生效。
level-name 字串 world 「level-name」的值將作為世界名稱及其資料夾名。你也可以把你已生成的世界存檔複製過來,然後讓這個值與那個資料夾的名字保持一致,伺服器就可以載入該存檔。
部分字元,例如 ' (單引號)可能需要在前面加反斜槓號 \ 才能被正常應用。
level-seed 字串 空白 與單人遊戲類似,為你的世界定義一個種子
這裏有一些例子:minecraft,404,1a2b3c。
level-type 字串 minecraft:normal 使用世界預設ID,確定地圖所生成的類型。

使用世界預設ID時,需要在其中的「:」前加「\」轉義。原版世界預設ID可以省略其前面的「minecraft:」(即命名空間)。

minecraft:normal - 帶有丘陵、河谷、海洋等的標準的世界。
minecraft:flat - 一個沒有特性的平坦世界,可用generator-settings修改。
minecraft:large_biomes - 如同預設的世界,但所有生態域都更大。
minecraft:amplified - 如同預設的世界,但世界生成高度提高。
minecraft:single_biome_surface - 單一生態域世界,可用generator-settings修改。
log-ips 布林值 true 是否在有新玩家加入遊戲時,在伺服器日誌中記錄其IP位址。
true - 在日誌中記錄新加入玩家的IP位址。
false - 在日誌中隱藏新加入玩家的IP位址。
max-build-height 整數 256 玩家在遊戲中能夠建造的最大高度。可能會在該值較小時生成超過該值的地形。
max-chained-neighbor-updates 整數[需要更多資訊] 1000000 限制連鎖NC更新的數量,超過此數量的連鎖NC更新會被跳過。若為負數則無限制。
max-players 整數(0-2147483647) 20 伺服器同時能容納的最大玩家數量。請注意,線上玩家越多,對伺服器造成的負擔也就越大。同樣注意,伺服器的OP具有在人滿的情況下強行進入伺服器的能力:找到在伺服器根目錄下叫ops.json的檔案並打開,將需要此能力的OP下的bypassesPlayerLimit選項設定為true即可(預設值為false),這意味著OP將不需要在伺服器人滿時等待有玩家離開後再加入。過大的數值會使用戶端顯示的玩家列表崩壞。
max-tick-time
整數(0–(2^63 - 1)) 60000 設定每個tick花費的最大毫秒數。超過該毫秒數時,伺服器watchdog外掛將停止伺服器程式並附帶上資訊:伺服器的一個tick花費了60.00秒(最長也應該只有0.05秒);判定伺服器已崩潰,它將被強制關閉。遇到這種情況的時候,它會調用 System.exit(1)。

譯者註:如果你監測服務程式的返回代碼,此時返回代碼會為1。(習慣上,程式正常退出應當返回0)

-1 - 完全停用watchdog外掛(這個停用選項在14w32a快照中加入)
max-world-size
整數(1-29999984) 29999984 設定可讓世界邊界獲得的最大半徑值,單位為方塊。透過成功執行的指令能把世界邊界設定得更大,但不會超過這裏設定的最大方塊限制。如果設定的max-world-size超過預設值的大小,那將不會起任何效果。

例如:

  • 設定 max-world-size為1000將會有2000×2000的地圖邊界。
  • 設定 max-world-size為4000將會有8000×8000的地圖邊界。
motd 字串 A Minecraft Server 本屬性值是玩家用戶端的多人遊戲伺服器列表中顯示的伺服器資訊,顯示於名稱下方。
  • MOTD 支持樣式代碼
  • MOTD 支持特殊符號,比如"♥"。然而,這些符號需要轉換為Unicode轉義字元。你可以在這裏找到一個轉換器。
  • 如果MOTD超過59個字元,伺服器列表很可能會返回「通訊錯誤」。
network-compression-threshold
整數 256 預設會允許n-1位元組的資料包正常發送, 如果資料包為n字節或更大時會進行壓縮。所以,更低的數值會使得更多的資料包被壓縮,但是如果被壓縮的資料包字節太小將反而使壓縮後字節更大。
-1 - 完全停用資料包壓縮
0 - 壓縮全部資料包

註:以太網規範要求把小於64位元組的資料包填充為64位元組。因此,設定一個低於64的值可能沒有什麼好處。也不推薦讓設定的值超過MTU(通常為1500位元組)。

online-mode 布林值 true 是否讓伺服器對比Minecraft帳號資料庫驗證登入資訊。只有在你的伺服器並未與Internet連接時,才將這個值設為false。如果設為false,駭客就能夠使用任意假帳號連接伺服器!如果minecraft.net伺服器宕機或不可訪問,那麼該值設為true的伺服器會因為無法驗證玩家身份而拒絕所有玩家加入。通常,這個值設為true的伺服器被稱為「正版伺服器」。故意設定該變數為false的伺服器稱為「破解伺服器」(也稱離線伺服器),這類伺服器允許擁有未授權的Minecraft副本的玩家加入。
true - 啟用。伺服器會認為自己具有Internet連接,並檢查每一位連入的玩家。
false - 停用。伺服器不會嘗試檢查玩家。
op-permission-level 整數(1-4) 4 設定使用/op指令時OP的權限等級。所有存檔會從之前的存檔繼承能力和指令。
1 - OP可以繞過重生點保護。
2 - OP可以使用所有單人遊戲作弊指令(除了/publish,因為不能在伺服器上使用;/debug也是)並使用指令方塊。指令方塊和領域服服主/管理員有此等級權限。
3 - OP可以使用大多數多人遊戲中獨有的指令,包括 /debug,以及管理玩家的指令(/ban/op等等)。
4 - OP可以使用所有指令,包括 /stop, /save-all, /save-on/save-off
player-idle-timeout 整數 0 如果不為0,伺服器將在玩家的空閒時間達到設定的時間(單位為分鐘)時將玩家踢出伺服器
註:當伺服器接受到下列資料包之一時將會重設空閒時間:
prevent-proxy-connections 布林值 false 如果伺服器發送的ISP/AS和Mojang的驗證伺服器的不一樣,玩家將會被踢出。
true - 啟用。伺服器將會禁止玩家使用虛擬專用網路或代理。
false - 停用。伺服器將不會禁止玩家使用虛擬專用網路或代理。
pvp 布林值 true 是否允許PvP。也只有在允許PvP時玩家自己的箭才會受到傷害。
true - 玩家可以互相傷害。
false - 玩家無法互相造成傷害(也稱作玩家對戰環境PvE))。

註:由玩家造成的間接傷害(例如熔岩TNT等,某種程度上還有礫石)還是會傷害其他玩家。

query.port 整數(1-65534) 25565 設定監聽伺服器的端口號(參見 enable-query)。
rate-limit 整數 0 設定玩家被踢出伺服器前,可以發送的資料包數量。
設定為0表示關閉此功能。
rcon.password 字串 空白 設定RCON遠程訪問的密碼(參見enable-rcon)。RCON:能允許其他應用程式透過互聯網與Minecraft伺服器連接並互動的遠程控制台協議。
rcon.port 整數(1-65534) 25575 設定RCON遠程訪問的端口號。
require-resource-pack 布林值 false 當此選項啟用(設為true)時,玩家會被提示作出選擇(是否啟用伺服器資源包)。如果玩家拒絕則會被伺服器斷開連接。
  • 但是,若玩家使用Linux系統加入伺服器,遊戲目錄內的server-resource-packs沒有寫權限,則會提示「無法應用伺服器資源包」「所有依賴自訂資源包的功能都有可能不按預期工作」,並提示玩家「繼續」或「斷開連接」。若玩家選擇「繼續」,則仍可在此伺服器中遊戲。
resource-pack 字串 空白 可選選項,可輸入指向一個資源包的URI。玩家可選擇是否使用該資源包。

注意若該值含":"和"="字元,需要在其前加上反斜線(\),例如 http\://somedomain.com/somepack.zip?someparam\=somevalue 資源包大小理應不能超過

  • 50 MiB(1.15-pre5前)
  • 100 MiB(1.15-pre5到1.18-pre8)
  • 250 MiB(1.18-rc1起)

注意,下載成功或失敗由用戶端記錄,而非伺服器。

resource-pack-prompt 字串 空白

可選,用於在使用require-resource-pack時在資源包提示介面顯示自訂資訊。

與聊天組件語法一致,可以包含多行文字。

resource-pack-sha1 字串 空白 資源包的SHA-1值,必須為小寫十六進制,建議填寫它。這還沒有用於驗證資源包的完整性,但是它提高了資源包快取的有效性和可靠性。
server-ip 字串 空白 將伺服器與一個特定IP綁定。強烈建議留空該屬性值!
留空,或是填入你想讓伺服器綁定(監聽)的IP。
server-port 整數(1-65534) 25565 改變伺服器(監聽的)端口號。如果伺服器在使用NAT的網路中執行,該端口必須被轉發(在你有家用路由器/防火牆的前提下)。
simulation-distance 整數(3-32) 10 設定伺服器端可更新實體範圍的最大值,即玩家各個方向上的區塊數量(是以玩家為中心的半徑,不是直徑)。超出此範圍的實體不會被更新,對玩家也不可見。

預設/推薦設定為10,如果有嚴重卡頓的話,減少該數值。

spawn-animals 布林值 true 決定動物是否可以生成。
true - 動物可以正常生成。
false - 動物生成後會立即消失。

提示:如果你有嚴重的卡頓,可以設為false。

spawn-monsters 布林值 true 決定攻擊型生物(怪物)是否可以生成。
true - 啟用。怪物會生成於夜晚和黑暗處。
false - 停用。不會有任何怪物。

如果difficulty=0(即難易度設定為和平)的話,該屬性值不會有任何影響。

提示:如果你有嚴重的卡頓,可以設為false。

spawn-npcs 布林值 true 決定是否生成村民
true - 啟用。生成村民。
false - 停用。不生成村民。
spawn-protection 整數 16 透過將該值進行2x+1的運算來決定重生點的保護半徑。設定為1會保護以重生點為中心的3×3方塊的區域,2會保護5×5方塊的區域,3會保護7×7方塊的區域,以此類推。這個選項不在第一次伺服器啟動時生成,只會在第一個玩家加入伺服器時出現。如果伺服器沒有設定OP,這個選項會自動停用。設定為0將不會停用重生點保護,但會保護位於重生點的那一個方塊(13w05a前)。
設定為0會停用重生點保護(13w05a起,參見MC-666)。
sync-chunk-writes 布林值 true 啟用後區塊檔案以同步模式寫入。
text-filtering-config 字串[需要測試] 空白 伺服器中需要被屏蔽的文字。[需要測試]
use-native-transport 布林值 true 是否使用針對Linux平台的資料包收發最佳化。此選項僅會在Linux平台上生成。
true - 啟用。啟用Linux資料包收發最佳化。
false - 停用。停用Linux資料包收發最佳化。
view-distance 整數(3-32) 10 設定伺服器端發送給用戶端的世界資料量,也就是設定玩家各個方向上的區塊數量(是以玩家為中心的半徑,不是直徑)。它決定了伺服器端的可視距離。(另見顯示距離

預設/推薦設定為10,如果有嚴重卡頓的話,減少該數值。

white-list 布林值 false 啟用伺服器的白名單。

當啟用時,只有白名單上的使用者才能連接伺服器。白名單主要用於私人伺服器,例如提供給相識的朋友、透過應用流程謹慎選擇的陌生人等。

false - 不使用白名單。
true - 從whitelist.json檔案載入白名單。

注: OP會自動被視為在白名單上,所以無需再將OP加入白名單。

Java版1.12之前的版本中,announce-player-achievements 布林值(預設為true)屬性用於切換是否成就要廣播給所有玩家。該屬性已被移除,但如果已經設定了這條屬性,則遊戲規則announceAdvancements將自動更新,隨後從檔案中刪除這條屬性。

基岩版[]

屬性名稱 可選值 預設值 何時生效 作用 備註
gamemode survival (0), creative (1), adventure (2) survival 總是生效或新玩家進入時 設定新玩家的遊戲模式。 survival (0) - 生存模式

creative (1) - 創造模式 adventure (2) - 冒險模式

difficulty peaceful (0), easy (1), normal (2), hard (3) easy 總是生效 設定世界的遊戲難易度。 peaceful (0) - 和平

easy (1) - 簡單 normal (2) - 普通 hard (3) - 困難

level-type FLAT, LEGACY, DEFAULT DEFAULT 生成地形時 決定生成的地圖的類型。 FLAT - 平坦

LEGACY - 舊世界 DEFAULT - 預設

server-name 任意字串 Dedicated Server 總是生效 用作伺服器的名稱 作為伺服器在遊戲內伺服器列表中顯示的名稱。
max-players 正整數 10 總是生效 設定伺服器同時能容納的最大玩家數量。 這是應該能在伺服器上遊戲的玩家的最大數量。較高的值可能會影響伺服器效能。
server-port 任意整數 19132 總是生效 設定伺服器監聽的IPv4端口號。
server-portv6 任意整數 19133 總是生效 設定伺服器監聽的IPv6端口號。
level-name 任意字串 level 總是生效 該值用於世界的名稱以及資料夾名。你也可以複製你的存檔到這裏,並把該值修改成資料夾的名稱,以此替換伺服器載入的存檔。 使用/生成的存檔名稱。每個存檔在/worlds中都有單獨的資料夾。
level-seed 任意字串 空白(th34f1ju34facjn5f871df312h) 生成地形時 用於將世界隨機化 為世界定義一個種子。留空將隨機選擇種子。
online-mode true, false true 總是生效 是否身份驗證 如果為true,則每個連接的玩家都必須與Xbox Live進行身份驗證。
allow-list true, false false 總是生效 是否開啟白名單 如果為true,則玩家都必須要在allowlist.json檔案中才能登入伺服器。
allow-cheats true, false false 總是生效 是否允許作弊 如果為true,則伺服器將允許作弊行為(例如使用指令)。
view-distance 任意整數 10 總是生效 設定玩家可視距離最大值 單位為區塊。較高的值可能會影響伺服器效能。
player-idle-timeout 任意整數 30 總是生效 設定空閒玩家被踢出的時間 單位為分鐘。玩家空閒時間到達設定值後將被踢出,如果設定為0或被移除。
max-threads 整數 8 總是生效 設定伺服器嘗試使用的最大執行緒數 伺服器會儘可能多地使用執行緒。
tick-distance 範圍[4, 12]內的整數 4 總是生效 設定停止載入區塊的距離 當玩家遠離某個區塊的距離超過設定值後,該區塊會停止載入。較高的值可能會影響伺服器效能。
default-player-permission-level visitor, member, operator member 總是生效 設定新玩家加入時的權限 visitor-新玩家不可破壞方塊

member-新玩家正常加入 operator-新玩家加入時即為OP

texturepack-required true, false false 總是生效 是否強制載入資源包 如果為 true,則當伺服器有資源包時,將強制用戶端使用。
content-log-file-enabled true,false false 是否啟用錯誤日誌

Minecraft Classic 伺服器屬性[]

屬性 類型 預設值 描述
verify-names 布林值 true 驗證玩家的IP是否與其連接Minecraft.net的IP相同。如果啟用,在一台電腦上同幸運行伺服器端和用戶端的人會出現問題,伺服器看見的是本地IP(127.0.0.1),而Minecraft.net看到的是外部IP。除非上述情況發生,建議啟用該屬性。
true - 啟用。伺服器會和Minecraft.net檢查所有的名字。
false - 停用。伺服器會確保IP吻合。
admin-slot 布林值 false 允許OP在伺服器人滿時也能加入遊戲。
public 布林值 伺服器是否顯示在伺服器列表裏。
true - 伺服器會顯示在伺服器列表裏,任何人都能看到。
false - 只有掌握伺服器 URL(可以在externalurl.txt中找到)的人和掌握IP和端口的人才能加入。
server-name 字串 伺服器名稱,會顯示在伺服器名單上及有人正加入伺服器時。
  • 單行文字。部分字元,例如 '(單引號)可能需要在前面加反斜槓號\才能正確應用。
max-players 整數(0-256) 伺服器同時線上的最大玩家人數。注意,伺服器上玩家越多,伺服器使用的資源越多。同樣注意,伺服器管理員的連接不算在內。
max-connections 整數(1-3) 同一個IP允許的最大連接數。

注: 如果你嘗試設定的值大於3,它會被改回3。

motd 字串 MOTD 是Message of the day(每日一句)的簡寫,儘管你不用每天變更。MOTD是玩家加入伺服器時顯示的資訊。
grow-trees 布林值 是否允許樹苗長成為樹木。
true - 伺服器會允許樹苗長成為樹木。
false - 伺服器不會允許樹苗長成為樹木。

歷史[]

Clock
此段落需要更新。

理由:一些設定並沒有其首次加入時間

Java版Classic
伺服器1.2現今已存檔的最早版本。
可用的選項包括:portserver-namemax-playersmotdpublic
伺服器1.3加入了verify-names,驗證玩家的IP是否與其連接Minecraft.net的IP相同。
伺服器1.5加入了max-connections,限制一個IP位址的最大連接數。
伺服器1.9.1加入了grow-trees,除非將其設定為true,否則樹苗將不會長成樹木。
伺服器1.10加入了verify-names停用時的警告。
加入了admin-slot,關閉它將使OP無法在伺服器人滿時加入遊戲。
Java版Alpha
伺服器0.1.0移除了全部選項,加入了level-nameserver-ipserver-port選項。
伺服器0.1.1加入了online-mode選項,如果設定為true將要求玩家使用線上登陸。
伺服器0.2.0加入了monsters選項,如果設定為true將生成怪物。
伺服器0.2.2加入了hellworld選項,預設為false,如果設定為true將啟用地獄。
伺服器0.2.4加入了no-animals選項,如果設定為true則不會生成動物。
伺服器0.2.5加入了pvp選項,停用或者啟用玩家對戰(PVP)。
monsters重新命名為spawn-monsters並將預設設定為true。
no-animals重新命名為spawn-animals
Java版Beta
1.3加入了white-list
1.5加入了allow-flight
1.6hellworld重新命名為allow-nether
加入了view-distance,設定了大視距。
1.8加入了difficulty
加入了gamemode
加入了motd
Java版
1.0.0Beta 1.9-pre4加入了debugenable-queryenable-rconquery.portrcon.passwordrcon.port
1.111w49a加入了spawn-npcs
12w01a加入了level-type
正式版加入了generate-structures
1.2.112w07a加入了max-build-height
1.3.112w30a加入了snooper-enabled
1.3加入了hardcore[需要更多資訊]
加入了texture-pack[需要更多資訊]
1.4.212w32a加入了enable-command-block,但不會在預設配置中生成。
12w39a加入了generator-settings
12w40a加入了spawn-protection
1.513w05aspawn-protection設定為0會把重生點保護關閉了,而不是像以前一樣保護1×1的範圍(MC-666)。
1.6.113w16a加入了force-gamemode
13w18a加入了op-permission-level
1.7.213w36aresource-pack重新命名為texture-pack
13w37b加入了player-idle-timeout
正式版加入了announce-player-achievements
1.7.5加入了broadcast-rcon-to-ops
1.814w18a加入了max-world-size
14w28a加入了自訂網路壓縮選項network-compression-threshold
14w31a加入了max-tick-time
加入了resource-pack-hash
1.8.1pre1加入了broadcast-rcon-to-ops
加入了use-native-transport
1.8.4加入了broadcast-console-to-ops
1.1116w38a加入了prevent-proxy-connections
1.1217w18a遊戲規則announceAdvancements取代選項announce-player-achievements,啟動遊戲時會將此選項移除並變更遊戲規則。
1.1318w19a加入了enforce-whitelist
1.1418w48adifficultygamemode設定使用字串,整數仍舊可以使用。
1.14.4pre4加入了function-permission-level選項,可以控制函數的權限等級。
1.15pre5將伺服器資源包的大小上限提升到100MB。
1.1620w14a加入了sync-chunk-writes選項,是否停用新的同步區塊寫入。
20w16a加入了enable-jmx-monitoring選項,啟用將使MBean使用以毫秒為單位時間計時[需要更多資訊]
20w18a加入了enable-status
加入了entity-broadcast-range-percentage
20w20a移除了generate-structures
移除了generator-settings
移除了level-seed
移除了level-type
1.16.220w28a加入了rate-limit,設定資料包的速度限制。
1.16.4pre1加入了text-filtering-config
1.1720w45a加入了require-resource-pack,用於強制使使用者接受伺服器資源包。
20w49a移除了max-build-height
21w15a加入了resource-pack-prompt,用於在資源包提示介面中顯示自訂資訊。
1.1821w38a加入了simulation-distance,用於控制實體更新的距離範圍。
21w43a移除了snooper-enabled
21w44a加入了hide-online-players,用於控制伺服器端是否在響應用戶端狀態請求時發送線上玩家列表。
pre1重新加入了generate-structures
重新加入了generator-settings
重新加入了level-seed
重新加入了level-type
rc1將伺服器資源包的大小上限提升到250MB。
1.1922w11a加入了max-chained-neighbor-updates,用於限制連鎖NC更新的數量,超過此數量的連鎖NC更新會被跳過。
level-type的接受值改為世界預設ID。
22w17a加入了enforce-secure-profile,用於使伺服器要求玩家必須具有Mojang簽名的公鑰才能進入伺服器。
22w19a加入了previews-chat,用於啟用聊天預覽功能。
加入了臨時的test-rainbow-chat,用於在聊天預覽中以彩虹色顯示訊息文字。
pre1移除了test-rainbow-chat
1.19.1pre2enforce-secure-profile的預設值改為true。
1.19.322w42a移除了聊天預覽及與其相關的previews-chat
加入了initial-enabled-packsinitial-disabled-packs,用於指定要在建立世界過程中被選中並載入的資料包。
1.20pre1檔案現在預設以UTF-8編碼讀取,但仍保留先前編碼(ISO 8859-1/Latin 1)的後向相容性。
檔案現在會以UTF-8編碼寫入。
1.20.223w31a加入了log-ips,用於在玩家加入遊戲時在日誌中記錄其IP位址。
基岩版
1.6.1基岩版專用伺服器的首次發佈。
可用的選項包括:server-namegamemodedifficultyallow-cheatsmax-playersonline-modewhite-listserver-portserver-port-v6view-distancetick-distanceplayer-idle-timeoutmax-threadslevel-namelevel-seeddefault-player-permissiontexturepack-required
1.7.0default-player-permission重新命名為default-player-permission-level
1.12.0加入了content-log-file-enabled,用於啟用錯誤日誌。
1.13.0加入了compression-thresholdserver-authoritative-movementplayer-movement-score-thresholdplayer-movement-distance-thresholdplayer-movement-duration-threshold-in-mscorrect-player-movement
1.16.100server-authoritative-movement的預設值從true改為server-auth(原先的false現在改為client-auth)。
1.16.210加入了新的選項force-gamemodeserver-authoritative-block-break,以及將erver-auth-with-rewind重新命名為server-authoritative-movement
1.18.10white-list重新命名為allow-list
1.19.20加入了disable-player-interactionchat-restriction
1.19.41加入了client-side-chunk-generation-enabled
1.19.501.19.50.21加入了enable-lan-visibility

語言

Advertisement