/fog
/fog| Permission level required |
1 |
|---|---|
| Restrictions |
Cheat only |
{
"title": "<code>/fog</code>",
"rows": [
{
"field": "1",
"label": "(link to Permission level article, displayed as Permission level<br>required)"
},
{
"field": "(link to Option article, displayed as Cheat) only<br>",
"label": "(link to Commands#Restrictions article, displayed as Restrictions)"
}
],
"invimages": [],
"images": []
}
Used for managing active fog settings for players.
Usage
Fog settings pushed by this command are stored in each player's NBT data in a data structure similar to stack.
In this data structure, each element is in the format of (fogSettingID, userProvidedId). Multiple elements can share a same fogSettingID or userProvidedId. Duplicate elements are valid.
To push a new element into it, both fogSettingID and userProvidedId are required. To pop an element, userProvidedId is required. It searches from the top (newest) of the "stack", the first element with the specific userProvidedId is popped. All elememts with a specific userProvidedId can be removed together with remove mode. If you forget the userProvidedId of an element, then the only way to remove the elememt is editing the player's NBT via an NBT editor.
Each fog setting has fog effects of one or more of the six fog types (air, weather, water, lava, lava_resistance, powder_snow). When rendering, all fog settings in this are applied one by one from the bottom (oldest) to the top (newest) of this "stack". The fog effects defined in the later fog setting overrides the earlier's. Each fog type works independently.
Vanilla fog settings (biome fog, powder snow fog, etc) are applied before all fog settings in this "stack".
Syntax
fog <victim: target> push <fogID: string> <userProvidedId: string>- Pushes a fog setting into the fog "stack" of targeted players.
fog <victim: target> <mode: delete> <userProvidedId: string>- Pops a fog setting from the fog "stack", or removes all the fog settings with the specified userProvidedId from the "stack" of targeted players.
Arguments
victim: target: CommandSelector<player>
- Specifies the player(s) to be targeted.
- Must be a player name or a target selector. And it should be of player type.
fogID: string: basic_string
- Specifies a fog setting.
- Must be a string. And it must be a single word that has no space or a double-quoted string (When quoted,
\can be used to escape characters). Should be a fog setting name defined under the Json path"minecraft:fog_settings"."identifier"in the <resource_pack>/fogs/<fog_setting>.json file). See Fog#Vanilla fog settings for IDs of vanilla fog settings.
mode: delete: enum
- Specifies whether to pop or remove the fog "stack".
- Must be one of
popandremove.
userProvidedId: string: basic_string
- Specified the userProvidedId.
- Must be a string. And it must be a single word that has no space or a double-quoted string (When quoted,
\can be used to escape characters).
Result
| Command | Trigger | Bedrock Edition |
|---|---|---|
| Any | The command is incomplete, or any argument is not specified correctly. | Unparseable |
victim: target is a target selector that is not in player type. | Failed | |
victim: target fails to resolve to one or more online players (named players must be online). | ||
fog ... push ... | If the specified fog setting does not exist. | |
fog ... <mode: delete> ... | If there's no element with the specified userProvidedId in the fog "stack" of all targeted players. | |
| Any | Otherwise | Successful |
Output
| Command | Edition | Situation | Success Count |
|---|---|---|---|
| Any | Bedrock Edition | On fail | 0 |
| On success | The number of targeted players |
Examples
/fog @p push minecraft:fog_basalt_deltas test:fog
- Gives the nearest player the basalt deltas fog.
/fog @p pop test:fog or /fog @p remove test:fog
- Removes this fog from the nearest player.
History
| Bedrock Edition | |||||||
|---|---|---|---|---|---|---|---|
| 1.16.100 | beta 1.16.100.54 | Added /fog. | |||||