用Notepad++打开的server.properties文件
server.properties为Minecraft服务端用于配置多人游戏所有参数的文件。
如果您要编辑server.properties,尽管不同行之间的顺序可以打乱,但请确保您使用和原始的文件相同的结构。每一行的等号之前的文本为变量名,您不应该修改。等号后面为变量的值,您可以按照规则自行编辑。以 # 开头的一行为注释,添加、修改或移除注释行不会对服务端运行造成任何影响。
在编辑并保存server.properties的更改之后,服务端必须重新启动以使更改生效。
如果server.properties文件未列出下文中所有的属性(例如服务端版本更新加入新属性,或 server.properties 还未创建),那么请先运行一下服务端程序。程序会补全缺失的属性并将它们的值设为默认。
文件位置
本文件会在服务端第一次运行时自动生成(如果本来没有的话)。
| 操作系统 | 文件位置 | 注解 |
|---|---|---|
| Windows | Minecraft_Server.exe的相同目录下 | |
| Linux
Unix *nix/Mac |
工作目录路径(pwd) |
如果你在你的home目录下启动(/home/yourname),服务端文件也会在/home/yourname下创建。请按照下列步骤确保服务端文件能够如你希望地成功生成。
|
Server.properties
截至1.8.7,新创建的Minecraft服务器具有以下默认设置,第二行的日期会有不同:
#Minecraft server properties #(File modification datestamp) generator-settings= op-permission-level=4 allow-nether=true resource-pack-hash= level-name=world enable-query=false allow-flight=false announce-player-achievements=true server-port=25565 max-world-size=29999984 level-type=DEFAULT enable-rcon=false level-seed= force-gamemode=false server-ip= network-compression-threshold=256 max-build-height=256 spawn-npcs=true white-list=false spawn-animals=true hardcore=false snooper-enabled=true online-mode=true resource-pack= pvp=true difficulty=1 enable-command-block=false gamemode=0 player-idle-timeout=0 max-players=20 max-tick-time=60000 spawn-monsters=true generate-structures=true use-native-transport=true view-distance=10 motd=A Minecraft Server
Minecraft服务器属性
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| allow-flight | 布尔值 | false | 允许玩家在安装添加飞行功能的 mod 前提下在生存模式下飞行。
允许飞行可能会使作弊者更加常见,因为此设定会使他们更容易达成目的。在创造模式下本属性不会有任何作用。
|
| allow-nether | 布尔值 | true | 允许玩家进入下界。 |
| announce-player-achievements | 布尔值 | true | 玩家获得成就时是否在服务器中进行显示。 |
| difficulty | 整数(0-3) | 1 | 定义服务器的游戏难度(例如生物对玩家造成的伤害,饥饿与中毒对玩家的影响方式等)。
|
| enable-query | 布尔值 | false | 允许使用GameSpy4协议的服务器监听器。用于收集服务器信息。 |
| enable-rcon | 布尔值 | false | 是否允许远程访问服务器控制台。 |
| gamemode | 整数(0-3) | 0 | 定义默认游戏模式
|
| generate-structures | 布尔值 | true | 定义是否在生成世界时生成结构(例如NPC村庄)
注: 即使设为 false,地牢和下界要塞仍然会生成 |
| generator-settings | 字符串 | 空白 | 本属性质用于自定义超平坦世界的生成。详见超平坦世界了解正确的设定及例子。 |
| hardcore | 布尔值 | false | 一旦启用,玩家在死后会自动被服务器封禁(即开启极限模式)。 |
| level-name | 字符串 | world | “level-name”的值将作为世界名称及其文件夹名。你也可以把你已生成的世界存档复制过来,然后让这个值与那个文件夹的名字保持一致,服务器就可以载入该存档。
|
| level-seed | 字符串 | 空白 | 与单人游戏类似,为你的世界定义一个种子。
|
| level-type | 字符串 | DEFAULT | 确定地图所生成的类型
|
| max-build-height | 整数 | 256 | 玩家在游戏中能够建造的最大高度。然而地形生成算法并不会受这个值的影响。 |
| max-players | 整数(1-2147483647) | 20 | 服务器同时能容纳的最大玩家数量。但请注意在线玩家越多,对服务器造成的负担也越大,而且服务器OP也不具有在人满的情况下强行进入服务器的权力。所以请慎重设置本属性,过大的数值会使客户端显示的玩家列表崩坏。 |
| max-tick-time | 整数(0–(2^63 - 1)) | 60000 | The maximum number of milliseconds a single tick may take before the server watchdog stops the server with the message, A single server tick took 60.00 seconds (should be max 0.05); Considering it to be crashed, server will forcibly shutdown. Once this criteria is met, it calls System.exit(1).
|
| max-world-size | 整数(1-29999984) | 29999984 | This sets the maximum possible size in blocks, expressed as a radius, that the world border can obtain. Setting the world border bigger causes the commands to complete successfully but the actual border will not move past this block limit. Setting the max-world-size higher than the default doesn't appear to do anything.
|
| motd | 字符串 | A Minecraft Server | 本属性值是玩家客户端的多人游戏服务器列表中显示的服务器讯息,显示于名称下方。
|
| online-mode | 布尔值 | true | 是否允许在线验证。服务器会与 Minecraft 的账户数据库对比检查连入玩家。如果你的服务器并未与 Internet 连接,则将这个值设为 false ,然而这样的话破坏者也能够使用任意假账户登录服务器。如果 Minecraft.net 服务器下线,那么开启在线验证的服务器会因为无法验证玩家身份而拒绝所有玩家加入。通常,这个值设为 true 的服务器被称为“正版服务器”,设为 false 的被称为“离线服务器”或“盗版服务器”。
|
| op-permission-level | 整数(1-4) | 4 | 设定OP的权限等级
|
| player-idle-timeout | 整数 | 0 | 玩家空闲超时的时间,设置为0表示无超时限制。
|
| texture-pack | 字符串 | 空白 | 客户端加入服务器后是否会自动下载资源包。请在这里填入完整的资源包URL。注意:这个链接必须直接连到事实的资源包ZIP文件,而且虽然资源包可以是高清的,服务器并不会对玩家服务端进行自动高清修补。所以如果你想让大多数玩家都能够使用该资源包的话,请使用标准16x16清晰度。 |
| resource-pack-hash | 字符串 | 空白 | 资源包的SHA-1值,必须为小写十六进制,虽然不是必填选项,但可减少每次进入服务器时重复下载资源包的情况。
|
| pvp | 布尔值 | true | 是否允许PvP。玩家自己的箭也只有在允许PvP时才可能伤害到自己。 |
| query.port | 整数(1-65534) | 25565 | 设置监听服务器的端口号(详见enable-query)。 |
| rcon.password | 字符串 | 空白 | 设置远程访问的密码(详见enable-rcon)。 |
| rcon.port | 整数(1-65534) | 25575 | 设置远程访问的端口号(详见enable-rcon)。 |
| server-ip | 字符串 | 空白 | 将服务器与一个特定IP绑定。强烈建议你留空本属性值!
|
| server-port | 整数(1-65534) | 25565 | 改变服务器端口号。如果服务器通过路由器与外界连接的话,该端口必须也能够通过路由器。
|
| snooper-enabled | 布尔值 | true | 自1.3正式版之后,一旦启用,将允许服务端定期发送统计数据到http://snoop.minecraft.net.
|
| spawn-animals | 布尔值 | true | 决定动物是否可以生成。
|
| spawn-monsters | 布尔值 | true | 决定攻击型生物(怪兽)是否可以生成。
如果difficulty = 0(和平)的话,本属性值不会有任何影响。 |
| spawn-npcs | 布尔值 | true | 决定是否生成村民。
|
| spawn-protection | 整数 | 16 | Determines the radius of the spawn protection. Setting this to 0 will not disable spawn protection. 0 will protect the single block at the spawn point. 1 will protect a 3x3 area centered on the spawn point. 2 will protect 5x5, 3 will protect 7x7, etc. This option is not generated on the first server start and appears when the first player joins. If there are no ops set on the server, the spawn protection will be disabled automatically. |
| use-native-transport | 布尔值 | true | 是否使用针对Linux平台的数据包收发优化,此选项仅会在Linux平台下生成。
|
| view-distance | 整数(3-15) | 10 | 设置服务端传送给客户端的数据量。用每一个方向上的区块数量衡量。这个值也是客户端视野距离的上限。当视野为“远”时,实际的值为9,所以默认推荐值为 10 。 |
| white-list | 布尔值 | false | 允许服务器白名单
当启用时,只有白名单上的用户才能连接服务器。白名单主要用于私人服务器,例如相识的朋友等。
|
| enable-command-block | 布尔值 | false | 当启用时地图中的命令方块可以被红石所激活
|
Minecraft Classic 服务器属性
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| verify-names | 布尔值 | true | 验证玩家的IP是否与其连接Minecraft.net的IP相同。如果启用,会在内部网络中造成问题。
|
| admin-slot | 布尔值 | false | 允许OP在服务器人满时也能加入游戏。 |
| public | 布尔值 | 服务器是否显示在服务器列表里。
| |
| server-name | 字符串 | 服务器名称,会显示在服务器名单上。
| |
| max-players | 整数(0-256) | 服务器同时在线的最大玩家人数。服务器OP不被计算在内。 | |
| max-connections | 整数(1-3) | 同一个IP允许的最大连接数。 | |
| motd | 字符串 | motd是玩家加入服务器时显示的信息。 | |
| grow-trees | 布尔值 | 是否允许树苗长成为树木。
|
历史
在Minecraft Beta 1.8里,当spawn-monsters=false且difficulty=1时,怪物还是能够从刷怪箱里生成。