# How to Change Game Rules on a Minecraft Bedrock Server

Use gamerule in the Bedrock server console to change keepinventory, sleep, mob griefing and more on an existing world, without losing achievements by accident.

Updated 2026-10-03. https://gamezservers.com/guides/how-to-change-game-rules-on-a-minecraft-bedrock-server

To change game rules on a Minecraft Bedrock server, type `gamerule <rule> <value>` in the server console without a slash, for example `gamerule keepinventory true`, or `/gamerule` in chat as an operator with cheats on. Rules are saved in the world's `level.dat`, so they apply to your existing world straight away and survive restarts, but only for that world. Type `gamerule` alone to list every rule. Before turning cheats on, know that a Bedrock world with cheats enabled loses achievements for good.

## What you can change on an existing world

| Change | Existing world | Needs a new world |
| --- | --- | --- |
| Game rules (`keepinventory`, `mobgriefing`, sleep percentage and the rest) | Yes, right away, no restart | |
| Difficulty and default game mode | Yes, after a restart | |
| Allow cheats | Yes, but achievements are gone for that world afterwards | |
| Experimental features such as Beta APIs | Only by editing the world in the game client | |
| Hardcore | | Yes, chosen when the world is created |
| Seed and world type | | Yes |

## Where do Bedrock game rules live?

| Setting | Stored in | How to change it |
| --- | --- | --- |
| Game rules | `worlds/<level-name>/level.dat` | `gamerule` command |
| `difficulty`, `gamemode`, `allow-cheats` | `server.properties` | The file, or the panel on GamezServers |
| Experiments | `level.dat` | Only through the client's world settings |
| Operators | `permissions.json` | `op "Gamertag"` in the console |

Because game rules sit inside `level.dat`, each world folder in `worlds` has its own set. Switch `level-name` to another world and you get that world's rules. Upload a world and it brings the rules it was made with.

## Which Bedrock game rules are worth changing?

Some Bedrock rule names differ from Java's, so commands copied from a Java guide can fail. Use the names the `gamerule` command lists. Defaults below are from the [Minecraft Wiki's game rule page](https://minecraft.wiki/w/Game_rule).

| Rule | Default | What it does | Friend server pick |
| --- | --- | --- | --- |
| `keepinventory` | false | Keep items and XP on death | `true` for relaxed groups |
| `playerssleepingpercentage` | 100 | Percent of players who must sleep to skip the night | `1` so one sleeper is enough |
| `mobgriefing` | true | Creepers break blocks, endermen take blocks, villagers farm | `false` protects builds but stops villager farming too |
| `doinsomnia` | true | Phantoms spawn when you skip sleep | `false` to remove phantoms |
| `dofiretick` | true | Fire spreads and burns out | `false` for wooden bases |
| `tntexplodes` | true | TNT explodes | `false` on public servers |
| `pvp` | true | Players can damage each other | `false` for co-op only |
| `doimmediaterespawn` | false | Skip the death screen | Personal taste |
| `showcoordinates` | true | Coordinates on screen | Keep on |
| `showdaysplayed` | false | Day counter on screen | `true` for long running worlds |
| `spawnradius` | 10 | How far from spawn new players appear | `0` for a spawn hub |
| `playerwaypoints` | everyone | The locator bar, `everyone` or `off` | Personal taste |
| `randomtickspeed` | 1 | Crop and plant growth speed | Leave it, higher costs CPU |

`playerwaypoints` was called `locatorbar` before Bedrock 26.30, so older guides that use the old name return a syntax error on a current server.

![A Minecraft Bedrock world with a village and fields, where game rules like mobgriefing and keepinventory apply](https://gamezservers.com/games/minecraft-bedrock/shot-2.jpg)

## Step 1: Back up first

Press **Backup**, or copy the world folder in `worlds` while the server is stopped. Game rules are easy to change back, but cheats and achievements are not, and the backup is the only way back if you change your mind about cheats.

## Step 2: See the current rules

In the server console, type:

```
gamerule
```

The server lists every rule with its current value. No slash, and no cheats needed, because the console has full rights.

## Step 3: Change a rule

```
gamerule keepinventory true
gamerule playerssleepingpercentage 1
gamerule mobgriefing false
```

Each change applies right away and is saved into `level.dat`. There is nothing to restart.

## Step 4: Or change rules from in game chat

Operators can use `/gamerule keepinventory true` in chat, but most commands in chat need cheats on for the world (`allow-cheats=true` in `server.properties`, then a restart). If achievements matter to your group, use the console instead and leave cheats off. Every console command is in [Minecraft Bedrock server commands](https://gamezservers.com/guides/minecraft-bedrock-server-commands).

## The gotcha: cheats switch off achievements permanently

On Bedrock, a world that has had cheats enabled is marked for good, and achievements stay off in it even after you turn cheats back off. Players set `allow-cheats=true` "just for a minute" to fix one thing with `/gamerule` in chat, and the whole group loses achievements on a world they have played for months.

The Minecraft Wiki lists a set of rules that the client's world settings can change without enabling cheats: `dotiledrops`, `domobloot`, `tntexplodes`, `doimmediaterespawn`, `naturalregeneration`, `playerssleepingpercentage`, `dofiretick`, `recipesunlock`, `respawnblocksexplode`, `showcoordinates`, `showdaysplayed`, `showrecipemessages`, `showtags` and `playerwaypoints`. Everything else, `keepinventory` and `mobgriefing` included, counts as a cheat rule.

The safe habit: decide on cheats when the world is new. If you need a cheat rule on a world you care about, take a backup first, so you can return to the version that still had achievements.

## Common problems

- **"Unknown command" in the console:** you typed a slash, or a Java only command. Console commands have no slash.
- **Syntax error on a rule name:** a Java name or an old name. Use the names the `gamerule` command lists, and `playerwaypoints` instead of `locatorbar`.
- **"You do not have permission" in chat:** you are not an operator, or cheats are off. Use the console, or op yourself with `op "Gamertag"`.
- **Rules gone after switching worlds:** each world keeps its own rules in its `level.dat`. Set them again on that world.
- **Difficulty or game mode reverts after a restart:** those come from `server.properties`, which our panel writes on every start. Change them in Settings.
- **Achievements stopped working:** cheats were enabled on this world at some point. Restore a backup from before that.

## Game rules on GamezServers

On a [Minecraft Bedrock server from GamezServers](https://gamezservers.com/games/minecraft-bedrock), the **Console** tab runs `gamerule` with full rights, so you can tune a world without turning cheats on, and **Keep inventory** is a one click button. **Allow cheats**, **Difficulty** and **Game mode** are in Settings, and **Backup** covers you before anything permanent. For world level features like experiments, see [how to add add-ons to a Minecraft Bedrock server](https://gamezservers.com/guides/how-to-add-addons-to-a-minecraft-bedrock-server).

## FAQ

### How do I turn on keep inventory on a Bedrock server?

Type `gamerule keepinventory true` in the server console. It applies straight away and stays on for that world.

### Do game rules reset when the Bedrock server restarts?

No. They are saved in the world's `level.dat`, so they survive restarts. Only switching to a different world gives you different rules.

### Does changing game rules disable achievements on Bedrock?

Turning cheats on for the world disables achievements permanently. Several rules, such as `playerssleepingpercentage` and `showcoordinates`, can be changed without cheats.

### How do I make one player sleeping skip the night on Bedrock?

Run `gamerule playerssleepingpercentage 1` in the console. One sleeping player is then enough to skip the night.
