# Keep inventory, daylight cycle and other game rules

> Change game rules and the difficulty from the console or the settings, and save the commands you use often.

Source: https://fadehost.com/docs/gamerules/

Game rules are switches inside the world: keep inventory on death, whether the day cycle runs, mob griefing, and forty more. They are set with a command, by an operator or from the console.

## From the console

In the **Console** tab:

```
gamerule keepInventory true
gamerule doDaylightCycle false
gamerule mobGriefing false
gamerule playersSleepingPercentage 1
gamerule doFireTick false
```

Rules apply at once and are saved with the world. `gamerule` alone lists them all.

## Difficulty and the rest

Difficulty, spawn protection, command blocks, flight, view distance and player slots are server settings, not game rules: **Settings**, **Server**. They take effect on the next restart.

## Save what you run often

**Commands** keeps named commands you can run with one click, and **Scheduler** runs them on a timer: a nightly `save-all`, a restart warning, a daily `weather clear`. See [Custom commands](/docs/custom-commands/) and [Scheduled tasks](/docs/scheduled-tasks/).

## Good to know

- Game rules are per world; a reset world starts with the defaults.
- `playersSleepingPercentage 1` lets one sleeping player skip the night on a busy server.
- Some rules only exist on newer versions; the console says so when a rule is unknown.
