Skip to content
托管 · 服务器配置

游戏规则:完整列表与示例

Minecraft 游戏规则:keepInventory、mobGriefing、doDaylightCycle,以及它们在 1.21.11 中的名称(keep_inventory 等)——各自的作用和在服务器上的设置方法。

更新于 2026年9月28日

游戏规则是控制世界行为的开关。它们通过命令设置,并存储在世界本身中,而不是在配置里:每个世界都有自己的一套。

gamerule keepInventory true
gamerule mobGriefing false

不带值时,命令会显示当前值:gamerule keepInventory。

从 Java 1.21.11 起,所有规则都改为下划线风格命名,在 1.21.11 和 26.x 版本的服务器上,命令这样写:gamerule keep_inventory true、gamerule mob_griefing false。两种名称都列在下表中。

最常用的规则

1.21.10 之前的规则自 1.21.11 起作用
keepInventorykeep_inventory死亡后物品保留 —
mobGriefingmob_griefing苦力怕和末影人破坏方块
doDaylightCycleadvance_time昼夜循环
doWeatherCycleadvance_weather天气循环
doFireTickfire_spread_radius_around_player(0 — 火不蔓延)火焰蔓延
doMobSpawningspawn_mobs生物自然生成
doInsomniaspawn_phantoms幻翼生成
doImmediateRespawnimmediate_respawn跳过死亡界面直接重生
showDeathMessagesshow_death_messages聊天栏中的死亡消息
announceAdvancementsshow_advancement_messages进度消息
naturalRegenerationnatural_health_regeneration基于饱和度的生命恢复
fallDamage、fireDamage、drowningDamagefall_damage、fire_damage、drowning_damage伤害类型
randomTickSpeedrandom_tick_speed植物生长速度(默认 3)
spawnRadiusrespawn_radius重生点分布范围
playersSleepingPercentageplayers_sleeping_percentage跳过夜晚所需的入睡玩家百分比 — 睡觉
maxEntityCrammingmax_entity_cramming实体挤压阈值
disableElytraMovementCheckelytra_movement_check(取值相反)禁用鞘翅飞行检查
commandBlockOutputcommand_block_output命令方块输出到控制台
sendCommandFeedbacksend_command_feedback聊天栏中的命令反馈
reducedDebugInforeduced_debug_info为玩家精简 F3 信息

注意事项

randomTickSpeed 高于 20 会让服务器变成幻灯片:每个 tick 处理的方块数量是原来的三倍。这是“不小心”掉 TPS 最常见的方式 — 常见卡顿原因。

doFireTick false(自 1.21.11 起为 fire_spread_radius_around_player 0)常与防破坏一起设置:一道闪电引发的火焰可能将木质建筑彻底烧毁。

不同世界

在世界网络中,规则需要为每个世界单独设置:/execute in minecraft:the_nether run gamerule ...,或在对应的世界中执行。

Minecraft 托管您离线时服务器仍在运行创建服务器