Gamerules allow changing specific things on servers like the day/night cycle, creepers exploding, mobs dropping items when they die, or even keeping a player's inventory upon death.
The first step to using Gamerules is to make sure your account has been made a server operator.
Next, log into your Minecraft server.
Gamerule commands are as shown below:
Use CTRL + F to find specific gamerules.
announceAdvancements - Whether advancements should be announced in chat
commandBlocksEnabled - Whether command blocks should be enabled in-game
commandBlockOutput - Whether command blocks should notify admins when they perform commands
disableElytraMovementCheck - Whether the server should skip checking player speed when the player is wearing elytra
doTraderSpawning - Whether wandering traders can spawn
doWeatherCycle - Whether the weather will change
drowningDamage - Whether the player should take damage when drowning
fallDamage - Whether the player should take fall damage
fireDamage - Whether the player should take fire damage
forgiveDeadPlayers - Makes angered neutral mobs stop being angry when the targeted player dies nearby.
keepInventory - Whether the player should keep items in their inventory after death
logAdminCommands - Whether to log admin commands to server log
maxCommandChainLength - Determines the number at which the chain command block acts as a "chain"
doDaylightCycle - Whether the day-night cycle and moon phases progress
doEntityDrops - Whether entities that are not mobs should have drops
disableRaids - Whether raids are disabled or not
randomTickSpeed - How often a random block tick occurs (such as plant growth, leaf decay, etc.) per chunk section per game tick. 0 will disable random ticks, higher numbers will increase random ticks
reducedDebugInfo - Whether the debug screen shows all or reduced information; and whether the effects of F3+B (entity hitboxes) and F3+G (chunk boundaries) are shown
sendCommandFeedback - Whether the feedback from commands executed by a player should show up in chat. Also affects the default behavior of whether command blocks store their output text
universalAnger - Makes angered neutral mobs attack any nearby player, not just the player that angered them. Works best if you disable forgiveDeadPlayers.
doMobSpawning - Whether mobs should naturally spawn
doPatrolSpawning - Whether patrols can spawn
doTileDrops - Whether blocks should have drops
doFireTick - Whether fire should spread and naturally extinguish
doInsomnia - Whether phantoms can spawn in the nightmare
doImmediateRespawn - Players respawn immediately without showing the death screen.
doLimitedCrafting - Whether players should only be able to craft recipes that they've unlocked first
showCoordinates - Whether the player's coordinates are displayed
showDeathMessages - Whether a message appears in chat when a player dies
spawnRadius - The number of blocks outward from the world spawn coordinates that a player will spawn in when first joining a server or when dying without a spawnpoint
spectatorsGenerateChunks - Whether players in spectator mode can generate chunks
tntExplodes - Whether TNT will explode or not after activation
doMobLoot - Whether mobs should drop items
maxEntityCramming - The maximum number of pushable entities another entity can try to push, before taking suffocation damage. Setting to 0 disables the rule. Affects players and mobs only (excluding bats)
mobGriefing - Whether creepers, zombies, endermen, ghasts, withers, ender dragons, rabbits, sheep, and villagers should be able to change blocks and whether villagers, zombies, skeletons, and zombie pigmen can pick up items
naturalRegeneration - Whether the player can regenerate health naturally if their hunger is full enough (doesn't affect external healing, such as golden apples, the Regeneration effect, etc.)
pvp - Whether the player can fight with other players
Congratulations! You now know How to Use Game Rules in Minecraft.
Summary:
- Make sure you have been set as the server operator
- Log into the game
- Enter Gamerule commands in chat