> ## 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 Java server

> Change Minecraft Java Edition game rules through World Manager, the Purpify console, or in-game chat.

Use `gamerule` to change world mechanics without restarting the Java server. Game rule names are case-sensitive.

## Change game rules in World Manager

<Steps>
  <Step title="Stop the server">
    Stop the Java server before editing its world settings.
  </Step>

  <Step title="Open World Manager">
    Open the server in the Purpify game panel and go to **World Manager**.
  </Step>

  <Step title="Edit the active world">
    Find the world currently used by the server and select **Edit**.
  </Step>

  <Step title="Open Game Rules">
    Go to **Game Rules** and change the rules you need.
  </Step>

  <Step title="Save and restart">
    Save the world settings, start the server, and confirm the new behavior in-game.
  </Step>
</Steps>

## Set a game rule with a command

<Tabs>
  <Tab title="Game panel console">
    Start the server, open its console view, and enter the command without `/`.

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

  <Tab title="In Minecraft">
    Join as an [operator](/java/manage-players), open chat, and include `/`.

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

Use this format for another rule:

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

## Common Java game rules

| Rule                        | Value             | What it controls                                             |
| --------------------------- | ----------------- | ------------------------------------------------------------ |
| `keepInventory`             | `true` or `false` | Whether players retain inventory and experience after death. |
| `mobGriefing`               | `true` or `false` | Whether mobs can change blocks or collect items.             |
| `doFireTick`                | `true` or `false` | Whether fire spreads and extinguishes naturally.             |
| `playersSleepingPercentage` | Percentage        | Players required to sleep before skipping the night.         |
| `randomTickSpeed`           | Number            | Frequency of random block ticks.                             |
| `doMobSpawning`             | `true` or `false` | Whether mobs spawn naturally.                                |
| `doDaylightCycle`           | `true` or `false` | Whether time and moon phases advance.                        |
| `doWeatherCycle`            | `true` or `false` | Whether weather changes naturally.                           |
| `showDeathMessages`         | `true` or `false` | Whether death messages appear in chat.                       |
| `commandBlockOutput`        | `true` or `false` | Whether command-block output is sent to operators.           |

## Check the current value

Enter a rule without a value:

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

<Card title="Manage Java players" icon="user-shield" href="/java/manage-players">
  Grant the operator access required for in-game administration.
</Card>
