🎉 Save 25% on your first month with code: DOOM25

How to Use Game Rules in Minecraft: Complete Command Guide

Learn how to customize your Minecraft server using game rules. Discover essential commands to control mob spawning, weather, inventory, PvP, and more without mods or plugins.

Andreas
7 min read
Sep 20, 2024
Last updated: Sep 20, 2024

Understanding Minecraft Game Rules

Game rules are powerful configuration options that allow you to modify your Minecraft server's gameplay without using mods or plugins. These built-in settings can dramatically change how your server functions, from basic gameplay mechanics to advanced server features.

Prerequisites

Before you can modify game rules:

  • You must have operator (OP) status on the server
  • Access to the server console or in-game commands
  • Basic understanding of Minecraft commands

If you need operator status, check our guide on how to become an operator.

Basic Game Rule Commands

To view all available game rules:

/gamerule

To check a specific game rule's current value:

/gamerule <ruleName>

To change a game rule:

/gamerule <ruleName> <value>

Essential Game Rules

Player Experience Rules

Keep Inventory

Controls whether players keep their items after death

/gamerule keepInventory <true|false>
  • true: Players keep all items when they die
  • false: Items drop on death (default)

Announce Advancements

Manages achievement announcements

/gamerule announceAdvancements <true|false>
  • true: Shows player achievements in chat
  • false: Silently awards achievements

Show Death Messages

Controls death notifications

/gamerule showDeathMessages <true|false>
  • true: Displays death messages in chat
  • false: Silently handles player deaths

World Behavior Rules

Daylight Cycle

Controls day/night cycle

/gamerule doDaylightCycle <true|false>
  • true: Normal day/night cycle
  • false: Freezes time at current position

Weather Cycle

Manages weather changes

/gamerule doWeatherCycle <true|false>
  • true: Normal weather changes
  • false: Locks current weather

Mob Spawning

Controls creature spawning

/gamerule doMobSpawning <true|false>
  • true: Mobs spawn normally
  • false: Prevents new mob spawning

Protection Rules

Mob Griefing

Controls mob environment interaction

/gamerule mobGriefing <true|false>
  • true: Mobs can modify blocks
  • false: Prevents mob block modification

PvP Combat

Manages player combat

/gamerule pvp <true|false>
  • true: Players can damage each other
  • false: Prevents player combat

TNT Explosions

Controls explosion damage

/gamerule tntExplodes <true|false>
  • true: TNT causes explosions
  • false: Disables TNT explosions

Advanced Usage Tips

Combining Game Rules

Combine multiple rules for specific gameplay experiences:

  • Peaceful server: Disable PvP and mob griefing
  • Creative building: Disable weather and daylight cycles
  • Hardcore experience: Enable all damage-related rules

Performance Optimization

Some rules can improve server performance:

  • Disable mob spawning in quiet areas
  • Freeze weather in unused chunks
  • Limit entity processing where possible

Common Configurations

Beginner-Friendly Server

/gamerule keepInventory true
/gamerule mobGriefing false
/gamerule doWeatherCycle false

Building Server

/gamerule doDaylightCycle false
/gamerule doWeatherCycle false
/gamerule mobSpawning false

PvP Server

/gamerule keepInventory false
/gamerule showDeathMessages true
/gamerule pvp true

Troubleshooting

Common issues and solutions:

  • Command not working: Verify operator status
  • Rules not saving: Check server permissions
  • Changes not applying: Restart affected game systems

Need help configuring your server's game rules? Contact our support team for assistance.