Some smaller settings of your world can’t be changed in the regular server options. To alter them, you need to use the /gamerule
command.
/gamerule <rule> <value>
<rule> the name of the gamerule you want to change
<value> the value you want to set it to
This example will enable the keepInventory gamerule:
/gamerule keepInventory true
[Server thread/INFO]: Gamerule keepInventory is now set to: true
The command is available on both Minecraft Java Edition and Minecraft Bedrock Edition, although the set of available gamerules might differ slightly. A full list of available gamerules can be found on the Minecraft Wiki.
It is also worth noting that on Minecraft Java Edition, all gamerule names are case sensitive.
Level.dat
Gamerules can also be changed directly in a world's level.dat file. This allows you to change gamerules without starting your server. On Bukkit/Spigot/PaperMC, you can set gamerules per world rather than globally.
Accessing a world's level.dat file is possible via the Options button on the Worlds page.
Bukkit/Spigot/PaperMC
In Bukkit based servers, gamerules are set per dimension rather than globally. The /gamerule
command will only update gamerules for the dimension you are currently standing in.
Other dimensions
If you want to change a gamerule in a specific dimension, you can use the /execute
command:
/execute in <dimension> run gamerule <rule> <value>
<dimension> the dimension you want to target
(minecraft:overworld, minecraft:the_end, or minecraft:the_nether)
<rule> the name of the gamerule you want to change
<value> the value you want to set it to