Gamerule Command in Minecraft Java Edition

Learn how to use the /gamerule command in Minecraft Java Edition. Set and check game rules with step-by-step instructions.

The /gamerule command lets you control how your Minecraft world behaves. You can toggle features on and off, tweak game settings, and create custom gameplay rules. Here’s how to use it.

What You Need

To run any gamerule commands, you need to have cheats enabled in your world. You can turn cheats on when you create a new world, or enable them in an existing world through the world settings.

Basic Gamerule Syntax

The /gamerule command works in two ways: you can set a rule to a new value, or check what the current value is.

Set a Gamerule

/gamerule <rule> <value>

Check a Gamerule

/gamerule <rule>

Command Breakdown

  • rule = The name of the game rule you want to change or check
  • value = The new value for that rule. This can be true/false, or a number depending on the rule

Common Gamerules

Rule What It Does Possible Values Default
doDaylightCycle Controls if day/night cycle advances true or false true
doMobSpawning Controls if mobs spawn naturally true or false true
doWeatherCycle Controls if weather changes true or false true
keepInventory Players keep items after dying true or false false
mobGriefing Mobs can pick up items or change blocks true or false true
naturalRegeneration Players heal naturally from hunger bar true or false true
showDeathMessages Chat shows messages when players die true or false true
doEntityDrops Entities drop items when killed true or false true
doMobLoot Mobs drop loot when killed true or false true
doTileDrops Blocks drop items when broken true or false true
doFireTick Fire spreads and burns naturally true or false true
doLimitedCrafting Players can only craft unlocked recipes true or false false
randomTickSpeed How fast crops and trees grow Number (0 = off) 3
spawnRadius How far you can spawn from spawn point Number in blocks 10
commandBlockOutput Command blocks notify admins when run true or false true
announceAdvancements Chat announces when players get advancements true or false true
sendCommandFeedback Chat shows results of your commands true or false true
maxEntityCramming Max number of entities in one block Number 24

Examples

Freeze Time

Stop the day/night cycle in your world:

/gamerule doDaylightCycle false

Stop Mob Spawning

Prevent mobs from spawning naturally:

/gamerule doMobSpawning false

Keep Items After Death

Players no longer lose their inventory when they die:

/gamerule keepInventory true

Faster Plant Growth

Make crops and trees grow faster:

/gamerule randomTickSpeed 6

Check Current Setting

See what a gamerule is currently set to:

/gamerule keepInventory

How to Run Commands

Step 1: Open Chat

Press T on your keyboard to open the chat window.

Step 2: Type Your Command

Type the /gamerule command exactly as shown above. Make sure you spell the rule name correctly.

Step 3: Press Enter

Hit Enter to run the command. You’ll see a message confirming the change.

Leave a Reply

Your email address will not be published. Required fields are marked *