# How to Set Game Rules on Your Minecraft Bedrock Server (/docs/minecraft-bedrock/game-rules)



import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
import { Step, Steps } from 'fumadocs-ui/components/steps';

Game rules control core gameplay behavior — mob spawning, PvP, item drops on death, day/night cycle, and more. Bedrock has several rules that don't exist on Java Edition.

Requirements [#requirements]

* **Cheats must be enabled** — see [Enable Cheats](/docs/minecraft-bedrock/cheats-setup)
* **OP permissions** are needed to run gamerule commands — see [OP Setup](/docs/minecraft-bedrock/op-setup)

> Enabling cheats disables achievements for the world. This is permanent and cannot be reversed.

How to Change a Game Rule [#how-to-change-a-game-rule]

<Steps>
  <Step>
    Open the Console [#open-the-console]

    In the [XGamingServer Panel](https://panel.xgamingserver.com), click **Console** in the sidebar.

    {/* Screenshot needed: Console page with command input */}
  </Step>

  <Step>
    Run the command [#run-the-command]

    ```
    gamerule <ruleName> <value>
    ```

    For example, to enable keep inventory:

    ```
    gamerule keepInventory true
    ```

    Changes take effect **immediately** — no restart needed.
  </Step>
</Steps>

To check the current value of any rule, run it without a value:

```
gamerule keepInventory
```

Complete Game Rules Reference [#complete-game-rules-reference]

<Tabs items={['Survival & Combat', 'World & Environment', 'Spawning & Mobs', 'Display & UI', 'Technical']}>
  <Tab value="Survival & Combat">
    | Rule                   | Default | Description                                                                    |
    | ---------------------- | ------- | ------------------------------------------------------------------------------ |
    | `keepInventory`        | false   | Players keep items and XP on death                                             |
    | `pvp`                  | true    | Players can damage each other. **Bedrock-exclusive**                           |
    | `naturalRegeneration`  | true    | Health regenerates when hunger is full                                         |
    | `doImmediateRespawn`   | false   | Skip the death screen entirely                                                 |
    | `drowningDamage`       | true    | Players take damage when out of air                                            |
    | `fallDamage`           | true    | Players take fall damage                                                       |
    | `fireDamage`           | true    | Players take fire, lava, and magma damage                                      |
    | `freezeDamage`         | true    | Players take damage in powder snow                                             |
    | `respawnBlocksExplode` | true    | Beds and respawn anchors explode in the wrong dimension. **Bedrock-exclusive** |
  </Tab>

  <Tab value="World & Environment">
    | Rule              | Default | Description                                                                                                                                        |
    | ----------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
    | `doDaylightCycle` | true    | Day and night cycle progresses                                                                                                                     |
    | `doWeatherCycle`  | true    | Weather changes over time                                                                                                                          |
    | `doFireTick`      | true    | Fire spreads to nearby flammable blocks                                                                                                            |
    | `tntExplodes`     | true    | TNT blocks can detonate                                                                                                                            |
    | `mobGriefing`     | true    | Mobs can modify blocks (creeper explosions, enderman block pickup, ghast fireballs)                                                                |
    | `randomTickSpeed` | **1**   | Speed of random block ticks (crop growth, leaf decay, grass spread). **Bedrock default is 1** (Java default is 3). Set to `0` to freeze all growth |
    | `doTileDrops`     | true    | Blocks drop items when broken                                                                                                                      |
    | `doMobLoot`       | true    | Mobs drop items and XP when killed                                                                                                                 |
    | `doEntityDrops`   | true    | Non-mob entities (minecarts, item frames) drop items                                                                                               |

    > `randomTickSpeed` is one of the most commonly changed rules. Setting it to `3` matches Java Edition speed. Setting it higher (like `100`) makes crops grow almost instantly — useful for testing.
  </Tab>

  <Tab value="Spawning & Mobs">
    | Rule                        | Default | Description                                                                                            |
    | --------------------------- | ------- | ------------------------------------------------------------------------------------------------------ |
    | `doMobSpawning`             | true    | Mobs spawn naturally in the world                                                                      |
    | `doInsomnia`                | true    | Phantoms spawn when players haven't slept for 3+ in-game days                                          |
    | `doPatrolSpawning`          | true    | Pillager patrols spawn in the world                                                                    |
    | `doTraderSpawning`          | true    | Wandering traders spawn periodically                                                                   |
    | `playersSleepingPercentage` | 100     | Percentage of online players that must sleep to skip the night. Set to `0` so a single player can skip |
    | `spawnRadius`               | 10      | Radius (in blocks) around the world spawn point where players may randomly spawn                       |
  </Tab>

  <Tab value="Display & UI">
    These rules are **Bedrock-exclusive** and have no Java equivalent:

    | Rule                 | Default | Description                                                           |
    | -------------------- | ------- | --------------------------------------------------------------------- |
    | `showCoordinates`    | true    | Show X, Y, Z position in the top-left corner of every player's screen |
    | `showDaysPlayed`     | false   | Show the in-game day count on screen                                  |
    | `showDeathMessages`  | true    | Death messages appear in chat                                         |
    | `showRecipeMessages` | true    | Toast notifications when recipes are unlocked                         |
    | `showTags`           | true    | Display name tags above players and mobs                              |
    | `showBorderEffect`   | true    | Show world border particles                                           |

    > `showCoordinates` does **not** require cheats to toggle — it can be changed even with `allow-cheats=false`. However, it does require OP or being set before the world loads.
  </Tab>

  <Tab value="Technical">
    | Rule                        | Default | Description                                                      |
    | --------------------------- | ------- | ---------------------------------------------------------------- |
    | `commandBlockOutput`        | true    | Command blocks broadcast their output to chat                    |
    | `sendCommandFeedback`       | true    | Commands show their output to the player who ran them            |
    | `commandBlocksEnabled`      | true    | Command blocks can execute                                       |
    | `maxCommandChainLength`     | 65536   | Maximum number of command blocks that can chain in a single tick |
    | `functionCommandLimit`      | 10000   | Maximum commands per function file per tick                      |
    | `doLimitedCrafting`         | false   | Players can only craft recipes they've unlocked                  |
    | `recipesUnlock`             | true    | Recipes unlock as players collect ingredients                    |
    | `projectilesCanBreakBlocks` | true    | Projectiles can destroy certain blocks                           |
  </Tab>
</Tabs>

Popular Configurations [#popular-configurations]

Peaceful Building Server [#peaceful-building-server]

```
gamerule pvp false
gamerule mobGriefing false
gamerule doMobSpawning false
gamerule doFireTick false
gamerule keepInventory true
gamerule showCoordinates true
```

Hardcore Survival [#hardcore-survival]

```
gamerule naturalRegeneration false
gamerule doImmediateRespawn false
gamerule playersSleepingPercentage 100
gamerule keepInventory false
```

Event / Minigame Server [#event--minigame-server]

```
gamerule pvp true
gamerule keepInventory true
gamerule doImmediateRespawn true
gamerule showCoordinates true
gamerule doDaylightCycle false
gamerule doWeatherCycle false
```

Related Guides [#related-guides]

* [Enable Cheats](/docs/minecraft-bedrock/cheats-setup)
* [Give OP Permissions](/docs/minecraft-bedrock/op-setup)
* [Server Properties Reference](/docs/minecraft-bedrock/server-properties)
* [Enable Coordinates](/docs/minecraft-bedrock/enable-coordinates)
