How to Change Difficulty and Game Rules on a Minecraft Server
Difficulty and game rules shape how your Minecraft server plays. Here's how to change them via server.properties and the /gamerule command.

Difficulty and game rules are how you set the tone of a Minecraft server — peaceful builder's paradise or hardcore survival. This guide covers changing difficulty and the most useful /gamerule toggles, both in config and live.
Set difficulty in server.properties
The base difficulty lives in server.properties. Stop the server, edit the file, then restart:
difficulty=normal
hardcore=false
Values are peaceful, easy, normal, and hard. Setting hardcore=true locks difficulty to hard and bans players on death — a serious commitment for an SMP.
Change difficulty live
You don't have to restart to change difficulty. As an operator, run:
/difficulty hard
It takes effect instantly for everyone. Handy for ramping up a challenge mid-session.

The /gamerule command
Game rules are fine-grained toggles for world behaviour, changed live with /gamerule:
/gamerule keepInventory true
/gamerule doDaylightCycle false
/gamerule mobGriefing false
/gamerule doFireTick false
/gamerule randomTickSpeed 3
Run /gamerule <rule> with no value to see its current setting.
The rules worth knowing
A handful come up constantly:
- keepInventory: keep items on death — popular on relaxed SMPs.
- doDaylightCycle: freeze time (false locks day or night).
- mobGriefing: stop creepers and endermen from changing terrain (great for build servers).
- doFireTick: stop fire spreading — protects builds.
- doInsomnia: disable phantom spawns.
- showDeathMessages: toggle death announcements.
- spawnRadius: how far from spawn players appear.
Difficulty vs game rules
They're different tools. Difficulty scales combat, hunger, and mob behaviour globally. Game rules toggle *specific* mechanics regardless of difficulty. You'll usually set difficulty once in server.properties and tune a few game rules to taste. These are core to shaping a vanilla server and pair with the whitelist and op settings that define who can change them.
Per-player and permission notes
Only operators (or players with the right permission) can run /difficulty and /gamerule. On a plugin server you can gate these behind LuckPerms roles — see installing plugins. Changes to game rules persist in the world's level.dat, so they survive restarts.
More game rules worth knowing
Beyond the headline toggles, several game rules are genuinely useful for shaping a server:
/gamerule commandBlockOutput false # stop command-block spam in chat
/gamerule sendCommandFeedback false # quiet command output
/gamerule maxCommandChainLength 65536
/gamerule fallDamage true
/gamerule naturalRegeneration true # health regen from a full hunger bar
/gamerule playersSleepingPercentage 50 # % of players needed to skip night
playersSleepingPercentage is a favourite for multiplayer — set it to 50 (or lower) so the whole group doesn't have to sleep to skip the night. commandBlockOutput false keeps chat clean on map-maker servers.
How difficulty actually scales
Difficulty changes more than mob damage. As you go from easy to hard:
- Mob damage and spawn rates increase.
- Hunger can starve you on hard (on easy it stops at a few hearts; on normal at half a heart).
- Zombies can break doors and summon reinforcements on hard.
- Peaceful disables hostile mob spawns entirely and regenerates health quickly.
So difficulty sets the *survival* tension, while game rules toggle specific mechanics on top. Most servers pick a difficulty once and fine-tune a handful of rules — see the vanilla setup guide for where these sit in server.properties.
Persistence and permissions
Game rules are stored in the world's level.dat and persist across restarts — set them once and they stick. Only operators can change them by default; on a plugin server you can gate /gamerule and /difficulty behind LuckPerms so only certain ranks can touch them (see managing admins). If you run multiple worlds via Multiverse, each world keeps its own game rules, so you can have a hardcore world and a relaxed keepInventory world side by side. As always, back up before big rule changes on an established world.
Popular rule setups by server type
Different servers lean on different combinations, so here are a few sensible starting points:
- Relaxed building server:
keepInventory true,mobGriefing false,doFireTick false, difficultyeasy. Focus on creativity without losing work. - Balanced survival SMP: difficulty
normal,keepInventory false(deaths matter),playersSleepingPercentage 50so the group can skip nights easily. - Hardcore challenge: difficulty
hard,naturalRegenerationon, nokeepInventory— or true hardcore viahardcore=true. - Map-maker / adventure:
commandBlockOutput false,sendCommandFeedback false,doDaylightCycle falseto lock the time of day.
Mix and match to taste — these are toggles, not commitments, and you can change any of them live. Just back up before flipping something drastic like mobGriefing on an established world. For where difficulty sits in the config and how it interacts with a whitelist and op permissions, see those guides.
FAQ
How do I change difficulty on a Minecraft server?
Set difficulty= in server.properties and restart, or run /difficulty <level> live as an operator.
What does keepInventory do?
/gamerule keepInventory true makes players keep their items and XP when they die — common on casual servers.
How do I stop creepers destroying my builds?
Set /gamerule mobGriefing false. Creepers still explode and damage players but won't break blocks. Combine with doFireTick false.
Do game rules reset on restart?
No — they're saved in the world data and persist across restarts until you change them again.
Dialling in the perfect ruleset is part of the fun. Run your world on Nxeon's Minecraft server hosting with full root access to edit every config file directly.