You can set your Minecraft server's difficulty, default game mode and whether players keep their items when they die, either by editing server.properties or by running a few quick commands in the panel.
Difficulty
Difficulty controls how dangerous the world is, from no monsters to hard-hitting mobs and starvation.
- To set it permanently, open the Files tab, edit server.properties, and set difficulty= to peaceful, easy, normal or hard. Restart to apply.
- To change it live, run /difficulty hard in-game, or difficulty hard in the Console.
If you set hardcore=true, the server is locked to hard difficulty and players are banned when they die. That setting overrides the difficulty line.
Game mode
Game mode decides how players interact with the world.
- survival - the normal experience with health, hunger and mining.
- creative - unlimited blocks, flight and no damage.
- adventure - players can explore but cannot break blocks freely, good for maps.
- spectator - fly through the world and watch, no interaction.
Set the default for new players with gamemode=survival in server.properties. To change one player, use /gamemode creative YourUsername. To change the default without editing files, run /defaultgamemode creative.
Keep inventory
By default players drop everything when they die. To stop that, use the keepInventory game rule:
- Join the server as an op, or use the Console.
- Run /gamerule keepInventory true (drop the slash in the Console).
- That is it, the change saves with the world immediately.
This is a game rule, not a server.properties setting, so you will not find it in that file. It is stored per world, which means it follows the world folder if you swap or restore one.
Other handy game rules
Game rules tweak how the world behaves. A few popular ones:
- /gamerule doDaylightCycle false - freeze time.
- /gamerule mobGriefing false - stop creepers and endermen changing blocks.
- /gamerule doFireTick false - stop fire from spreading.
- /gamerule showDeathMessages false - hide death messages in chat.
- /gamerule doWeatherCycle false - lock the weather.
Making changes stick
Game rule and live /difficulty or /gamemode changes take effect instantly and save with the world. Edits to server.properties need a restart. If you are about to experiment, take a Backups snapshot first so you can undo a rule you did not mean to change.
Still stuck? Jump into our Discord at discord.gg/GuavaHost and the team will help you out.