> ## Documentation Index
> Fetch the complete documentation index at: https://docs.purpify.host/llms.txt
> Use this file to discover all available pages before exploring further.

# Set game rules on a Bedrock server

> Change Minecraft Bedrock Edition game rules through the Purpify console or in-game chat.

Use the `gamerule` command to change how the active Bedrock world behaves. Game rule names are case-sensitive.

## Before you begin

* Start the server and wait until the world finishes loading.
* [Enable cheats](/bedrock/enable-cheats) before changing game rules in Minecraft chat.
* Join as an [operator](/bedrock/operators) when using the in-game method.
* Create a [backup](/server/backups) before changing rules that could affect builds or player data.

## Set a game rule

<Tabs>
  <Tab title="Game panel console">
    Open the server console and enter the command without a leading `/`.

    ```text theme={"dark"}
    gamerule keepinventory true
    ```
  </Tab>

  <Tab title="In Minecraft">
    Open chat and enter the command with a leading `/`.

    ```text theme={"dark"}
    /gamerule keepinventory true
    ```
  </Tab>
</Tabs>

Use this format for another rule:

```text theme={"dark"}
gamerule <rule> <value>
```

## Common Bedrock game rules

| Rule                        | Value             | What it controls                                           |
| --------------------------- | ----------------- | ---------------------------------------------------------- |
| `keepinventory`             | `true` or `false` | Whether players keep inventory and experience after death. |
| `showcoordinates`           | `true` or `false` | Whether coordinates appear on the player HUD.              |
| `mobgriefing`               | `true` or `false` | Whether mobs can change blocks or pick up items.           |
| `domobspawning`             | `true` or `false` | Whether mobs spawn naturally.                              |
| `domobloot`                 | `true` or `false` | Whether mobs drop items and experience.                    |
| `dodaylightcycle`           | `true` or `false` | Whether time and moon phases advance.                      |
| `doweathercycle`            | `true` or `false` | Whether weather changes naturally.                         |
| `playerssleepingpercentage` | Percentage        | How many Overworld players must sleep to skip the night.   |
| `pvp`                       | `true` or `false` | Whether players can damage other players.                  |
| `randomtickspeed`           | Number            | How frequently random block ticks occur.                   |
| `tntexplodes`               | `true` or `false` | Whether activated TNT explodes.                            |
| `commandblocksenabled`      | `true` or `false` | Whether command blocks can run.                            |

## Check a game rule

Enter the rule without a value to display its current setting.

```text theme={"dark"}
gamerule keepinventory
```

<Card title="Use the server console" icon="terminal" href="/panel/console">
  Learn how to enter commands and inspect console output.
</Card>
