下载服务器文件
- 服务器系统 Ubuntu 22+
- 我们建议在至少具有 2 个内核和 1 Gb RAM 的 64 位 Intel 或 AMD 处理器机器上运行 Bedrock Minecraft 服务器。
下载后上传至服务器 并解压文件
宝塔服务器设置
服务器防火墙
阿里云服务器防火墙设置
记得 协议类型 选择全部流量!!!
配置
服务器将尝试读取名为 server.properties
的文件。其中一些选项仅在创建新世界时读取,而另一些选项则在每次启动时读取。该文件应包含一个列表,其中的键和值以等号分隔,每行一个。
有以下选项可用。如果值是括号中的数字,则可以使用该数字代替文本值。
Option name | Possible values | Default value | When is it used | Notes |
---|---|---|---|---|
server-name | Any string (no semicolon allowed) | Dedicated Server | Always | This is the server name shown in the in-game server list. |
gamemode | survival, creative, adventure | survival | Always or only for new players | |
force-gamemode | true, false | false | Always | force-gamemode=false(or force-gamemode is not defined in the server.properties file) 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 file 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 file after world creation. | ||||
difficulty | peaceful, easy, normal, hard | easy | Always | |
allow-cheats | true, false | false | Always | If true then cheats like commands can be used. |
max-players | Any integer | 10 | Always | The maximum numbers of players that should be able to play on the server. Higher values have performance impact. |
server-port | Integer between 1024 and 65535 | 19132 | Always | Values below 1024 may be used, but are generally reserved for well known applications |
server-portv6 | Integer between 1024 and 65535 | 19133 | Always | Values below 1024 may be used, but are generally reserved for well known applications |
enable-lan-visibility | true, false | true | Always | 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. |
level-name | Any string | Bedrock level | Always | The name of level to be used/generated. Each level has its own folder in /worlds . |
level-seed | Any string | World creation | The seed to be used for randomizing the world. If left empty a seed will be chosen at random. | |
online-mode | true, false | true | Always | If true, all connected players must be authenticated with 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 is highly recommended to enable online-mode. |
allow-list | true, false | false | Always | If true then all connected players must be listed in the separate allowlist.json file. See the Allowlist section. |
view-distance | Any integer greater than 5 | 32 | Always | The maximum allowed view distance. Higher values have performance impact. |
player-idle-timeout | Any positive integer, including 0 | 30 | Always | After a player has idled for this many minutes they will be kicked. If set to 0 then players can idle indefinitely. |
max-threads | Any integer | 8 | Always | Maximum number of threads the server will try to use. If set to 0 or removed then it will use as many as possible. |
tick-distance | An integer in the range [4, 12] | 4 | Always | The world will be ticked this many chunks away from any player. Higher values have performance impact. |
default-player-permission-level | visitor, member, operator | member | Always | Which permission level new players will have when they join for the first time. |
texturepack-required | true, false | false | Always | If the world uses any specific texture packs then this setting will force the client to use it. |
content-log-file-enabled | true, false | false | Always | Enables logging content errors to a file. |
compression-threshold | An integer in the range [0-65535] | 1 | Always | Determines the smallest size of raw network payload to compress. Can be used to experiment with CPU-bandwidth tradeoffs. |
compression-algorithm | zlib, snappy | zlib | Always | Determines the compression algorithm to use for networking. |
server-authoritative-movement-strict | true, false | false | Always | If true, will be more strict toward the Player position and be less permissive in accepting the client info. This will impact Player around moving block if there is high latency. |
server-authoritative-dismount-strict | true, false | false | Always | If true, will be more strict toward the Player dismount position. This means clients will receive a correction on their dismount position in higher latency situation. |
server-authoritative-entity-interactions-strict | true, false | false | Always | If true, will be more strict toward the Entity interactions. This will impact Players interacting with each other in higher latency situations. |
player-position-acceptance-threshold | Any positive float | 0.5 | Always | This is the tolerance of discrepancies between the Client and Server Player position. This helps in problematic scenarios. The higher the number, the more tolerant the server will be before asking for a correction. Passed value of 1.0, the chance of missing cheating increases. |
player-movement-action-direction-threshold | Any positive float in the range of [-1.00, 1.00] | 0.85 | Always | The amount that the direction the player is attacking can differ from the direction the player is looking as cos(x) where x is the angle between the two vectors. A value of 1 means the two vectors must be parallel, 0 means anything in front of the player, and -1 means any vector. |
server-authoritative-block-breaking | true, false | false | Not when client-auth | 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. This setting cannot be combined with client authoritative movement and will be disabled if that setting is enabled. |
server-authoritative-block-breaking-pick-range-scalar | Any float above 1.0 | 1.5 | When server-authoritative-block-breaking is true | This increase the range of block breaking. This is squared and multiplied with the default range. |
chat-restriction | None, Dropped, Disabled | None | Always | 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 | true, false | false | Always | 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, false | true | Always | 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, false | true | Always | 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 | true, false | false | Internal Use Only | |
disable-custom-skins | true, false | false | Always | 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, 0.0-1.0 | Disabled | Always | 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. |
文件夹
解压后,您将看到几个文件夹和一个二进制可执行文件。首次启动服务器时,将创建一堆新的(空)文件夹。您需要关注的文件夹如下:
Folder name | Purpose |
---|---|
behavior_packs | 这里可以安装新的行为包。目前还无法在关卡中激活它们。 |
resource_packs | 这里可以安装新的资源包。目前无法在关卡中激活它们。 |
worlds | 如果此文件夹不存在,则会在启动时创建。每个创建的世界都会有一个根据其文件level-name 内容命名的文件夹server.properties 。 |
允许列表
如果allow-list
启用了此属性,server.properties
则服务器将仅允许选定的用户连接。要允许用户连接,您需要知道他们的 Xbox Live 玩家代号。将用户添加到允许列表的最简单方法是使用命令allowlist add <Gamertag>
(例如:)allowlist add ExampleName
。注意:如果玩家代号中有空格,则需要用双引号将其括起来:allowlist add "Example Name"
如果您稍后想从列表中删除某人,您可以使用命令allowlist remove <Gamertag>
。
允许列表将保存在名为 的文件中allowlist.json
。如果您想自动执行从中添加或删除玩家的过程,您可以这样做。修改文件后,您需要运行该命令allowlist reload
以确保服务器知道您的新更改。
注意:此文件之前名为whitelist.json
。为了向后兼容,如果whitelist.json
存在其他文件,则将使用该文件代替allowlist.json
。要迁移,请删除默认allowlist.json
文件,重命名whitelist.json
为allowlist.json
,然后重启服务器。
该文件包含一个 JSON 数组,其中的对象包含以下键/值。
Key | Type | Value |
---|---|---|
name | String | 用户的玩家代号。 |
xuid | String | 可选。用户的 XUID。如果未设置,则当名称匹配的用户连接时,系统会填充该值。 |
ignoresPlayerLimit | Boolean | 如果此用户不应计入最大玩家限制,则为 True。目前,即使玩家使用此选项,连接玩家数量仍存在另一个软限制,即 30 人(或比指定的最大玩家数量多 1 人)。此限制的目的是即使服务器已满,也能让一些玩家加入。 |
示例 allowlist.json
文件:
1 | [ |
权限
permissions.json
您可以通过在与服务器可执行文件位于同一目录中的 中为玩家分配角色来调整玩家的特定权限。该文件包含一个带有 XUID 和权限的简单 JSON 对象。有效权限为: operator
、member
、visitor
每个使用这些帐户连接的玩家都将根据设置的权限进行处理。如果您在服务器运行时更 改此文件,请运行该命令permission reload
以确保服务器知道您的新更改。您还可以使用 列出当前权限permission list
。请注意,online-mode
需要启用 才能使此功能正常工作,因为 xuid 需要对用户帐户进行在线验证。如果不在该列表中的新玩家连接,default-player-permission-level
则将应用该选项。
示例permissions.json
文件:
1 | [ |
崩溃报告
如果服务器崩溃,它会自动向我们发送各种信息,帮助我们解决将来的问题。
命令
您可以通过在控制台中输入命令来向服务器发出命令。以下命令可用。< > 表示参数为必需参数,[ ] 表示参数为可选参数,| 表示不同的允许值。如果字符串包含空格,则可以用双引号 “ 括起来。
Command syntax | Description |
---|---|
kick < player name or xuid > < reason > | 立即踢出一名玩家。踢出原因将显示在被踢出玩家的屏幕上。 |
stop | 正常关闭服务器。 |
备份
服务器支持在运行时备份世界文件。手动备份不太方便,但自动备份效果更好。从服务器角度来看,备份包含三个命令。
Command | Description |
---|---|
save hold | 这将要求服务器准备备份。它是异步的,并将立即返回。 |
save query | 调用此命令后,save hold 您应该反复调用该命令,以查看准备工作是否完成。如果返回成功,它将返回一个文件列表(包含每个文件的长度),其中包含您需要复制的文件。服务器在执行此操作时不会暂停,因此某些文件可能会在备份过程中被修改。只要您只复制给定文件列表中的文件,并将复制的文件截断为指定的长度,备份就应该是有效的。 |
save resume | 当您完成文件复制后,您应该调用它来告诉服务器可以再次删除旧文件。 |