Time, weather and other game rules.
This command allows you to set the current weather type. Weather effects the entire world at the same time. Options are clear, rain(turns on snow in cold biome) or thunder (thunder snow in cold biome).
Syntax: /weather [weather type] [duration]
The duration is in seconds between 1 and 1000000. Duration defaults to 5 minutes if number is omitted. A repeating command block can be used to set the weather permanently. Use a long tick delay to avoid lag.
Note that special effects can happen during rain or lightning. Lightning can cause explosions or fire, although the fire is generally put out by the rain.
Lighting can also transform some creatures into charged variants:
Lightning can also create a "Skeleton Trap Horse." The chances are 0.75–1.5 percent on easy, 1.5–4 percent on normal, and 2.8125–6.75 percent on hard. When a player gets near a horse, it transforms into four skeleton horsemen. The trap disappears after 15 minutes if it has not been activated.
Here are some examples:
Time of day can be set with the "/time add" or "/time set" commands. Some mobs will only appear at night and will be set on fire when the sun comes out.
Syntax: /time add [amount] or /time set [amount]
Time runs from 0 to 23999 (1 hour = 1000). Words can also be used for /time set. Day = 1000, noon = 6000, sunset =12000, night = 13000, midnight = 18000, sunrise = 23000.
Here are some examples:
Game rules include many of the things found in the settings menu of Minecraft. Other options found hear can also be useful in customizing gameplay.
Syntax: /gamerule [rule name] [value]
Setting sendCommandFeedback and commandBlockOutput to false is important if you are doing repeating command blocks. Otherwise you will get spammed with notifications.
Here are some examples:
A list of game rules:
Rule name | Description | Default value | Value type |
---|---|---|---|
commandBlockOutput | Whether command blocks should notify admins when they perform commands | true | Boolean |
doDaylightCycle | Whether the day-night cycle and moon phases progress | true | Boolean |
doEntityDrops | Whether entities that are not mobs should have drops | true | Boolean |
doFireTick | Whether fire should spread and naturally extinguish | true | Boolean |
doInsomnia | Whether phantoms can spawn in the nighttime | true | Boolean |
immediateRespawn | Players respawn immediately without showing the death screen | false | Boolean |
doMobLoot | Whether mobs should drop items | true | Boolean |
doMobSpawning | Whether mobs should naturally spawn. Does not affect monster spawners. | true | Boolean |
doTileDrops | Whether blocks should have drops | true | Boolean |
doWeatherCycle | Whether the weather can change naturally. The /weather command can still change weather. | true | Boolean |
drowningDamage | Whether the player should take damage when drowning | true | Boolean |
fallDamage | Whether the player should take fall damage | true | Boolean |
fireDamage | Whether the player should take fire damage | true | Boolean |
keepInventory | Whether the player should keep items and experience in their inventory after death | false | Boolean |
mobGriefing | Whether creepers, zombies, endermen, ghasts, withers, ender dragons, rabbits, sheep, villagers, and snow golems should be able to change blocks and whether mobs can pick up items. This also affects the capability of zombie-like creatures like zombie pigmen and drowned to pathfind to turtle eggs. This will also prevent villagers from breeding. | true | Boolean |
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.) | true | Boolean |
pvp | Whether the player can fight with other players | true | Boolean |
randomTickSpeed | How often a random block tick occurs (such as plant growth, leaf decay, etc.) per chunk section per game tick. 0 disables random ticks, higher numbers increase random ticks. Setting to a high integer results in high speeds of decay and growth | 1 | Integer |
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 | true | Boolean |
showCoordinates | Whether the player's coordinates are displayed | true | Boolean |
showDeathMessages | Whether death messages are put into chat when a player dies. Also affects whether a message is sent to the pet's owner when the pet dies. | true | Boolean |
spawnRadius | The number of blocks outward from the world spawn coordinates that a player spawns in when first joining a server or when dying without a personal spawnpoint. | 5 | Integer |
tntExplodes | Whether TNT explodes after activation | true | Boolean |
Source: https://minecraft.gamepedia.com/
Previous lesson: Enchanting items | Next lesson: Cloning/filling