MCTOOLBOX
MC ToolboxMC TOOLBOX

World settings command

Minecraft Gamerule Command Generator

Search current Java and Bedrock game rules, inspect the default and data type, then copy a query or set command.

Generated command

JAVA 26.2
/gamerule minecraft:keep_inventory false

Find a gamerule (59/59)

Configure selected rule

minecraft:keep_inventory

Keep inventory

Keep inventory items and experience after death.

Type: booleanDefault: false

New value

Edition note: Java 26.1 and later use namespaced snake_case IDs such as minecraft:keep_inventory. These IDs are case-sensitive.

What Is the Minecraft Gamerule Command?

The /gamerule command queries or changes world-wide settings: death inventory, mob behavior, spawning, weather, command feedback, random block ticks, and more. Pick the edition and version first because Java 26.1 changed the rule registry, while Bedrock exposes a separate list and defaults.

Use /gamerule <rule> to query the current value, or /gamerule <rule> <value> to change it. Boolean rules accept true or false, integer rules accept whole numbers, and a small number of Bedrock rules use named choices.

Find the right rule

Search IDs and descriptions or filter by player, mobs, world, spawning, drops, commands, and display. The selected card shows the value type and default before you make a change.

Query before changing

Switch to Query current to generate a command with no value. This is useful on an existing world when you do not know whether a server owner already changed the default.

Version-aware Java syntax

Java 26.1 introduced namespaced snake_case gamerule IDs. The generator automatically switches between modern IDs such as minecraft:keep_inventory and legacy names such as keepInventory.

Defaults differ by edition

Java random tick speed defaults to 3, while Bedrock defaults to 1. Bedrock also includes settings such as showCoordinates that are not Java gamerules.

Changes persist per world

Game rules remain active after restarts until changed again. In Java 26.1 and later they are stored in data/minecraft/game_rules.dat rather than the old level.dat location.

Frequently Asked Questions

What is the /gamerule command syntax?

Use /gamerule <rule> to read a value and /gamerule <rule> <value> to set it. On Java 26.1+, for example, /gamerule minecraft:keep_inventory true keeps inventory and experience after death. Older Java versions use /gamerule keepInventory true.

Why did gamerule names change in Java 26.1?

Java 26.1 moved gamerules into a namespaced registry. Modern commands use resource-location IDs such as minecraft:random_tick_speed; Java 1.21.11 and earlier retain camelCase names such as randomTickSpeed.

Do gamerules work in Bedrock Edition?

Yes, but Bedrock supports a different set of rule names and defaults. Always switch the generator to Bedrock before copying a command for a Bedrock world or Realm.

What does random tick speed change?

It controls random block updates such as crop growth, leaf decay, fire behavior, and some plant spreading. Zero disables random ticks. Very high values can cause lag or make world changes happen unexpectedly fast.

Can I change gamerules without cheats?

Changing game rules requires sufficient command permission. In Java, use an operator account or the server console. In Bedrock, enable cheats or use an account with the required permission level.

Are gamerule changes permanent?

They are saved with the world and survive restarts, but they are not global to every world. Query the rule first when working on an existing server configuration.