Skip to content
In-house anti-DDoS, included on VPS, game servers and web hosting · hosted in France · cancel anytime See our plans
CloudFive
Log in

01

The /gamerule command

The command takes the name of a rule, then its new value:

/gamerule keep_inventory true
/gamerule keep_inventory
  • With a value, the command changes the rule. The value is true or false for an on/off rule, a whole number for the others.
  • Without a value, it shows the rule's current value.
  • Who can use it: it needs permission level 2, so you must be an operator (see Minecraft admin commands). In the server console, type the same command without the slash: gamerule keep_inventory true.
  • Names are case-sensitive. Type the start of the name, then press Tab: the game suggests the rules that exist in your version, which avoids typos.

The change takes effect right away and is saved with the world: it survives restarts, and it follows the world if you copy it to another server. A new world, on the other hand, starts again from the default values.

Gamerules do not replace server.properties: that file sets up the server (name, player count, difficulty, whitelist) and is only read at startup. It is covered in the guide server.properties explained.

02

The names changed in 1.21.11

In Minecraft Java 1.21.11, every gamerule was renamed: they are now written in lowercase with underscores (keep_inventory) instead of the old joined-up spelling (keepInventory). Some also got a new name, to match the labels of the game rules screen:

  • keepInventory becomes keep_inventory;
  • doDaylightCycle becomes advance_time;
  • doWeatherCycle becomes advance_weather;
  • doMobSpawning becomes spawn_mobs;
  • mobGriefing becomes mob_griefing;
  • playersSleepingPercentage becomes players_sleeping_percentage;
  • announceAdvancements becomes show_advancement_messages;
  • spawnRadius becomes respawn_radius;
  • doImmediateRespawn becomes immediate_respawn;
  • naturalRegeneration becomes natural_health_regeneration;
  • doInsomnia becomes spawn_phantoms;
  • disableRaids becomes raids, with an inverted value: raids false turns raids off.

doFireTick was removed. It is replaced by fire_spread_radius_around_player, the distance in blocks around a player within which fire spreads: 128 by default, 0 to stop all spreading, -1 for unlimited distance.

A little earlier, in version 1.21.9, four server.properties settings became gamerules: pvp, spawn-monsters, allow-nether and enable-command-block. Their current names are pvp, spawn_monsters, allow_entering_nether_using_portals and command_blocks_work.

Which name should you use? The one for your server's version: the old names up to 1.21.10, the new ones from 1.21.11. Many online tutorials predate the change: if a command is refused, Tab completion shows you the right name.

03

Useful rules for players

Here are the most requested rules on a server, with their current name and default value:

  • keep_inventory (false): set to true, players keep their items and experience on death. Very common on small servers among friends.
  • players_sleeping_percentage (100): the percentage of players in the Overworld who must sleep to skip the night. At 100, everyone must sleep, which quickly blocks a public server. A value of 30 to 50% is common; at 0, a single player is enough.
  • show_advancement_messages (true): announces players' advancements in chat. Set it to false if chat is too busy.
  • show_death_messages (true): shows death messages in chat.
  • respawn_radius (10): the radius, in blocks around the world spawn point, in which a player appears on first joining, or on death without a bed. At 0, everyone appears in exactly the same spot, handy for a built spawn.
  • immediate_respawn (false): set to true, the player respawns without going through the death screen.
  • natural_health_regeneration (true): health regeneration when the hunger bar is full enough. Golden apples and the Regeneration effect still heal.
/gamerule keep_inventory true
/gamerule players_sleeping_percentage 50
/gamerule respawn_radius 0
04

World rules: day, weather, mobs

  • advance_time (true): the day and night cycle. For permanent daylight, set the time first, then stop the cycle: /time set day, then /gamerule advance_time false.
  • advance_weather (true): weather changes. Same principle with /weather clear.
  • spawn_mobs (true): natural spawning of all creatures. spawn_monsters (true) only targets monsters, and only works if spawn_mobs is on.
  • spawn_phantoms (true): phantoms spawning above players who do not sleep.
  • mob_griefing (true): set to false, creepers, endermen and other creatures no longer change blocks, and mobs no longer pick up items. Be careful, it also affects villagers, who stop harvesting crops.
  • fire_spread_radius_around_player (128): at 0, fire no longer spreads, which protects wooden builds.
  • pvp (true): allows fights between players. The topic is covered in running a PvP server.

For specific areas, such as the spawn or a town, a gamerule is too broad: it applies to the whole world. The WorldGuard plugin sets rules per area (no explosions, no PvP); see protecting areas with WorldGuard.

05

Different rules for each world

Gamerules belong to a world. On a Paper or Purpur server running several worlds with Multiverse (a survival world, a creative world, an arena), each one can have its own rules. Multiverse has a command that targets a given world, even from the console:

/mv gamerule list creatif
/mv gamerule set keep_inventory true creatif

/mv gamerule list shows a world's rules with the exact names your version expects: if a name is refused, use the one from the list. Installation and the other per-world settings are in the guide Multiverse: several worlds on one server.

A few common combinations:

  • creative world: advance_time false, advance_weather false, spawn_mobs false;
  • survival among friends: keep_inventory true, players_sleeping_percentage at 50;
  • spawn world: mob_griefing false, fire_spread_radius_around_player 0, respawn_radius 0.

For a one-life challenge, you do not need a gamerule but hardcore mode, chosen when the world is created: see creating a hardcore Minecraft server.

06

On CloudFive

On our Minecraft hosting plans, the client area console accepts gamerule and mv commands directly, without being logged into the game. Paper, Purpur, Fabric, Forge, NeoForge and Modrinth modpacks install in one click, and backups let you roll back after a bad setting.

Java servers run in France on Ryzen 9 9950X, with DDR5 memory and NVMe storage, and Anti-DDoS Premium is included. Plans are monthly, with no commitment, from €8, with support in French 7 days a week. To get started, see creating a Minecraft server.

07

Frequently asked questions

How do I keep my inventory on death on a Minecraft server?

Type /gamerule keep_inventory true in game, as an operator, or gamerule keep_inventory true in the console. On versions before 1.21.11, the rule is called keepInventory. The change is immediate and stays saved with the world.

Why does my /gamerule command no longer work?

Since Minecraft Java 1.21.11, every gamerule has been renamed in lowercase with underscores: keepInventory became keep_inventory, doDaylightCycle became advance_time. Type the start of the name and press Tab to see the names for your version.

How do I skip the night without everyone sleeping?

Set the players_sleeping_percentage gamerule, which is 100 by default: with /gamerule players_sleeping_percentage 50, half of the players in the Overworld need to sleep. At 0, a single player is enough.

How do I stop creepers from destroying builds?

With /gamerule mob_griefing false, creatures no longer change blocks. The rule applies to the whole world and also stops villagers from harvesting: to protect a single area, use the WorldGuard plugin instead.

Do gamerules apply to every world on the server?

They are saved with each world. With Multiverse on Paper or Purpur, each world has its own rules: /mv gamerule set followed by the rule, the value and the world name sets them one by one.

Support CloudFive AI

An answer right away, a real team behind it.

CloudFive AI answers you at any hour, in seconds. When it doesn’t know, or as soon as you ask, the team that runs the machines takes over. No offshore call centre.

  • TicketThe team replies in under 2 hours, 7 days a week.
  • CloudFive AIAt any hour, on ia.cloudfive.fr, Discord and in your customer area.
  • DiscordThe team, the AI and other customers, in the help channel.
  • Your data stays with usAI runs on our servers in France; e-mails, IPs and passwords are masked.
A ticket in the customer area: a customer’s question about a Minecraft plugin, and the CloudFive team’s reply
A real ticket in the customer area, answered by the team (demo account; shown in French).
CUSTOMER AREA · APP

Your servers.
At your fingertips.

Restart a server, watch its resources live, pay an invoice or open a ticket — and get an alert when something goes wrong.

  • The status of all your services at a glance
  • Blocked attacks, filtered traffic, monthly peak
  • A notification when a server goes down or an invoice is due

App coming soon · in the meantime, everything works in your browser at manager.cloudfive.fr

The CloudFive app: the list of your services, with their status
The CloudFive app: the home screen, your services’ status, blocked attacks and an invoice to pay