Difference between revisions of "Registry Data"

From wiki.vg
Jump to navigation Jump to search
(Some more work done #2)
(→‎Dimension Type: More work on the dimension type registry)
Line 518: Line 518:
 
  ! Name
 
  ! Name
 
  ! Type
 
  ! Type
  !style="width: 250px;" colspan="2"| Meaning
+
  !style="width: 40%;" | Meaning
 
  ! Values
 
  ! Values
 
  |-
 
  |-
 
  | fixed_time
 
  | fixed_time
 
  | Optional TAG_Long
 
  | Optional TAG_Long
  | colspan="2"| If set, the time of the day fixed to the specified value.
+
  | If set, the time of the day fixed to the specified value.
 
  | Allowed values vary between 0 and 24000.
 
  | Allowed values vary between 0 and 24000.
 
  |-
 
  |-
 
  | has_skylight
 
  | has_skylight
 
  | TAG_Byte
 
  | TAG_Byte
  | colspan="2"| Whether the dimension has skylight access or not.
+
  | Whether the dimension has skylight access or not.
 
  | 1: true, 0: false.
 
  | 1: true, 0: false.
 
  |-
 
  |-
 
  | has_ceiling
 
  | has_ceiling
 
  | TAG_Byte
 
  | TAG_Byte
  | colspan="2"| Whether the dimension has a bedrock ceiling or not. When true, causes lava to spread faster.
+
  | Whether the dimension has a bedrock ceiling or not. When true, causes lava to spread faster.
 
  | 1: true, 0: false.
 
  | 1: true, 0: false.
 
  |-
 
  |-
 
  | ultrawarm
 
  | ultrawarm
 
  | TAG_Byte
 
  | TAG_Byte
  | colspan="2"| Whether the dimensions behaves like the nether (water evaporates and sponges dry) or not. Also causes lava to spread thinner.
+
  | Whether the dimensions behaves like the nether (water evaporates and sponges dry) or not. Also causes lava to spread thinner.
 
  | 1: true, 0: false.
 
  | 1: true, 0: false.
 
  |-
 
  |-
 
  | natural
 
  | natural
 
  | TAG_Byte
 
  | TAG_Byte
  | colspan="2"| When false, compasses spin randomly. When true, nether portals can spawn zombified piglins.
+
  | When false, compasses spin randomly. When true, nether portals can spawn zombified piglins.
 
  | 1: true, 0: false.
 
  | 1: true, 0: false.
 
  |-
 
  |-
 
  | coordinate_scale
 
  | coordinate_scale
 
  | TAG_Double
 
  | TAG_Double
  | colspan="2"| The multiplier applied to coordinates when traveling to the dimension.
+
  | The multiplier applied to coordinates when traveling to the dimension.
 
  | Allowed values vary between 1e-5 (0.00001) and 3e7 (30000000).
 
  | Allowed values vary between 1e-5 (0.00001) and 3e7 (30000000).
 
  |-
 
  |-
 
  | bed_works
 
  | bed_works
 
  | TAG_Byte
 
  | TAG_Byte
  | colspan="2"| Whether players can use a bed to sleep.
+
  | Whether players can use a bed to sleep.
 
  | 1: true, 0: false.
 
  | 1: true, 0: false.
 
  |-
 
  |-
 
  | respawn_anchor_works
 
  | respawn_anchor_works
 
  | TAG_Byte
 
  | TAG_Byte
  | colspan="2"| Whether players can charge and use respawn anchors.
+
  | Whether players can charge and use respawn anchors.
 
  | 1: true, 0: false.
 
  | 1: true, 0: false.
 
  |-
 
  |-
 
  | min_y
 
  | min_y
 
  | TAG_Int
 
  | TAG_Int
  | colspan="2"| The minimum Y level.
+
  | The minimum Y level.
 
  | Allowed values vary between -2032 and 2031, and must also be a multiple of 16.
 
  | Allowed values vary between -2032 and 2031, and must also be a multiple of 16.
 
{{warning|min_y + height cannot exceed 2032.}}
 
{{warning|min_y + height cannot exceed 2032.}}
Line 569: Line 569:
 
  | height
 
  | height
 
  | TAG_Int
 
  | TAG_Int
  | colspan="2"| The maximum height.
+
  | The maximum height.
 
  | Allowed values vary between 16 and 4064, and must also be a multiple of 16.
 
  | Allowed values vary between 16 and 4064, and must also be a multiple of 16.
 
{{warning|min_y + height cannot exceed 2032.}}
 
{{warning|min_y + height cannot exceed 2032.}}
Line 575: Line 575:
 
  | logical_height
 
  | logical_height
 
  | TAG_Int
 
  | TAG_Int
  | colspan="2"| The maximum height to which chorus fruits and nether portals can bring players within this dimension. (Must be lower than height)
+
  | The maximum height to which chorus fruits and nether portals can bring players within this dimension. (Must be lower than height)
 
  | Allowed values vary between 0 and 4064, and must also be a multiple of 16.
 
  | Allowed values vary between 0 and 4064, and must also be a multiple of 16.
 
{{warning|logical_height cannot exceed the height.}}
 
{{warning|logical_height cannot exceed the height.}}
Line 581: Line 581:
 
  | infiniburn
 
  | infiniburn
 
  | TAG_String
 
  | TAG_String
  | colspan="2"| A resource location defining what block tag to use for infiniburn.
+
  | A resource location defining what block tag to use for infiniburn.
 
  | "#" or minecraft resource "#minecraft:...".
 
  | "#" or minecraft resource "#minecraft:...".
 
  |-
 
  |-
 
  | effects
 
  | effects
 
  | TAG_String
 
  | TAG_String
  | colspan="2"| Defines special dimensional effects, which includes:
+
  | Defines special dimensional effects, which includes:
 
* Cloud level: Height at which clouds appear, if at all.
 
* Cloud level: Height at which clouds appear, if at all.
* Sky type: Whether it's the normal sky; the low-visibility foggy sky of the nether; or static sky of the end.
+
* Sky type: Whether it's the normal sky with sun and moon; the low-visibility, foggy sky of the nether; or the static sky of the end.
 
* Forced light map: Whether a bright light map is forced, siimilar to the night vision effect.
 
* Forced light map: Whether a bright light map is forced, siimilar to the night vision effect.
 
* Constant ambient light: Whether blocks have shade on their faces.
 
* Constant ambient light: Whether blocks have shade on their faces.
Line 598: Line 598:
 
  | ambient_light
 
  | ambient_light
 
  | TAG_Float
 
  | TAG_Float
  | colspan="2"| How much light the dimension has. Used as interpolation factor when calculating the brightness generated from sky light.
+
  | How much light the dimension has. Used as interpolation factor when calculating the brightness generated from sky light.
  | The default values are 0.0 and 0.1, 0.1 for the nether and 0.0 for the rest of dimensions.  
+
  | The default values are 0.0 and 0.1, 0.1 for the nether and 0.0 for the other dimensions.  
 
  |-
 
  |-
 
  | piglin_safe
 
  | piglin_safe
 
  | TAG_Byte
 
  | TAG_Byte
  | colspan="2"| Whether piglins shake and transform to zombified piglins.
+
  | Whether piglins shake and transform to zombified piglins.
 
  | 1: true, 0: false.
 
  | 1: true, 0: false.
 
  |-
 
  |-
 
  | has_raids
 
  | has_raids
 
  | TAG_Byte
 
  | TAG_Byte
  | colspan="2"| Whether players with the Bad Omen effect can cause a raid.
+
  | Whether players with the Bad Omen effect can cause a raid.
 
  | 1: true, 0: false.
 
  | 1: true, 0: false.
 
  |-
 
  |-
 
  | monster_spawn_light_level
 
  | monster_spawn_light_level
 
  | TAG_Int or TAG_Compound
 
  | TAG_Int or TAG_Compound
  | Possibly the light level(s) at which monsters can spawn.
+
  | During a monster spawn attempt, this is the maximum allowed light level for it to succeed. It can be either a fixed value, or one of several types of distributions.
  | colspan="2"| When TAG_Int, 0 - 15. When TAG_Compound, contains the fields: type (TAG_String), appears to be always "minecraft:uniform", and value (TAG_Compound), which contains the fields: max_inclusive (TAG_Int), min_inclusive (TAG_Int).
+
  | Can be either:
 +
* as a TAG_Int: Allowed values vary between 0 and 15.
 +
* as a TAG_Compound: See [[#Integer distribution|Integer distribution]].
 
  |-
 
  |-
 
  | monster_spawn_block_light_limit
 
  | monster_spawn_block_light_limit
 
  | TAG_Int
 
  | TAG_Int
  | colspan="2"|
+
  | Maximum allowed block light level monster spawn attempts to happen.
 
  | Allowed values vary between 0 and 15.
 
  | Allowed values vary between 0 and 15.
 +
The default values are 0 and 15, 15 for the nether (where monsters can spawn anywhere) and 0 for other dimensions (where monsters can only spawn naturally in complete darkness).
 +
|}
 +
 +
==== Integer distribution ====
 +
 +
Integer providers can be either declared as constants with a TAG_Int, or in a structured TAG_Compounds for specific distribution types. For the latter, the following format is used.
 +
 +
{{Need Info|The use for integer distributions described in the previous section pertains to monster spawning mechanisms, which is server-sided operation. The values received in the <code>monster_spawn_light_level</code> field have no noticeable impact on the client whatsoever. Should they even be described here?}}
 +
 +
{| class="wikitable"
 +
! Name
 +
! Type
 +
!style="width: 40%;" | Meaning
 +
! Values
 +
|-
 +
| type
 +
| TAG_String
 +
| The type of distribution.
 +
| Can be either:
 +
* <code>minecraft:constant</code>, for constant values, similarly to when declared as a TAG_Int.
 +
* <code>minectaft:uniform</code>, for uniformly distributed values between the specified range.
 +
* <code>minecraft:biased_to_bottom</code>, for values biased towards the lower end, between the specified range.
 +
* <code>minecraft:clamped</code>, for uniformly distributed values, clamped inside a range.
 +
* <code>minecraft:weighted_list</code>, for a weighted list of multiple distributions.
 +
* <code>minecraft:clamped_normal</code>, for normally distributed values, clamped inside a range.
 +
|-
 +
| value
 +
| TAG_Compound
 +
| Extra data pertaining to the type of distribution.
 +
| Depends on the type of distribution.
 
  |}
 
  |}
  

Revision as of 00:52, 29 October 2023

Registries are repositories of data that contain entries pertaining to certain aspects of the game, such as the world, the player, among others.

The ability for the server to send customized registries to the client was introduced in 1.16.3, which allows for a great deal of customization over certain features of the game.

Format

The server sends these registries to the client via Registry Data packet during the configuration phase.

Packet ID State Bound To Field Name Field Type Notes
0x05 Configuration Client Registry Data NBT Tag Compound Information included below.

The Registry Data field represents a list of all available registries in the form of a Compound Tag. Elements in this compound are defined by the registry information, associated with the registry's name, as shown in the example below:

{
    "minecraft:worldgen/biome": {
        "type": "minecraft:worldgen/biome",
        "value": [
            {
                "name": "minecraft:ocean",
                "id": 0,
                "element": { /* Element */ }
            },
            {
                "name": "minecraft:plains",
                "id": 1,
                "element": { /* Element */ }
            },
            { /* Registry Entry */ }
            ...
        ]
    },
    "minecraft:dimension_type": { /* Registry */ },
    "minecraft:chat_type": { /* Registry */ },
    ...
}

Registry

The Registry Compound Tag specifies the type of the registry, and a list of registry entries.

Warning.png The name of the registry in the Registry Data is always the same to the registry type in the Notchian implementation.

Name Type Notes
type TAG_String The type of the registry.
value TAG_List of TAG_Compound List of registry entries. The format of the entries is defined by the value of the previous field.

Registry Entry

The Registry Entry Compound Tag specifies a single entry of a Registry.

Name Type Notes
name TAG_String The name of the entry.
id TAG_Int The protocol ID of the entry.
element TAG_Compound The actual data of the entry.

Warning.png This field is context-dependent and is based on the type field of its Registry.

Available Registries

The current release specification allows for six different registries to be sent to the client, six of which are required. A brief explanation of each of them is presented below, along with the format of their entries' element field.

Armor Trim Material

The minecraft:trim_material registry.

Name Type Meaning Values
asset_name TAG_String <tba> <tba>
ingredient TAG_String <tba> <tba>
item_model_index TAG_Float <tba> <tba>
override_armor_materials Optional TAG_Compound <tba> <tba>
description TAG_Compound or TAG_String <tba> <tba>

Armor Trim Pattern

The minecraft:trim_pattern registry.

Name Type Meaning Values
asset_id TAG_String <tba> <tba>
template_item TAG_String <tba> <tba>
description TAG_Compound or TAG_String <tba> <tba>
decal TAG_Byte <tba> <tba>

Biome

The minecraft:worldgen/biome registry. It defines several aesthetic characteristics of the biomes present in the game.

Warning.png A registry entry for each biome implemented in the client must exist in the Biome registry, otherwise the client will crash with an exception due to the missing biome.

Name Type Meaning Values
has_precipitation TAG_Byte Determines whether or not the biome has precipitation. 1: true, 0: false.
temperature TAG_Float The temperature factor of the biome.

Affects foliage and grass color if they are not explicitly set.

The default values vary between -0.5 and 2.0.
temperature_modifier Optional TAG_String Modifier that affects the resulting temperature. Can be either:
  • none, for a static temperature throughout the biome (aside from variations depending on the height).
  • frozen, for pockets of warm temperature (0.2) to be randomly distributed throughout the biome. This is used on frozen ocean variants in the Notchian client to simulate spots of unfrozen water, where it always rains instead of snowing.
downfall TAG_Float The downfall factor of the biome.

Affects foliage and grass color if they are not explicitly set.

The default values vary between 0.0 and 1.0.
effects TAG_Compound Biome special effects. See Effects.

Effects

Name Type Meaning Values
fog_color TAG_Int The color of the fog effect when looking past the view distance. Example: 8364543, which is #7FA1FF in RGB.
water_color TAG_Int The tint color of the water blocks. Example: 8364543, which is #7FA1FF in RGB.
water_fog_color TAG_Int The color of the fog effect when looking past the view distance when underwater. Example: 8364543, which is #7FA1FF in RGB.
sky_color TAG_Int The color of the sky. Example: 8364543, which is #7FA1FF in RGB.
foliage_color Optional TAG_Int The tint color of leaves.

If not specified, the foliage color is calculated based on biome temperature and downfall.

Example: 8364543, which is #7FA1FF in RGB.
grass_color Optional TAG_Int The tint color of the grass.

If not specified, the grass color is calculated based on biome temperature and downfall.

Example: 8364543, which is #7FA1FF in RGB.
grass_color_modifier Optional TAG_String Modifier that affects the resulting grass color. Can be either:
  • none, for a static grass color throughout the biome.
  • dark_forest, for a darker, and less saturated shade of the color.
  • swamp, for overriding it with two fixed colors (#4C763C and #6A7039), randomly distributed throughout the biome.
particle Optional TAG_Compound Ambient visual particles. See Particle.
ambient_sound Optional TAG_String or TAG_Compound Ambient soundtrack that starts playing when entering the biome, and fades out when exiting it. Can be either:
  • as a TAG_String: the ID of a soundtrack, such as "minecraft:ambient.basalt_deltas.loop".
  • as a TAG_Compound: see Ambient sound.
mood_sound Optional TAG_Compound Additional ambient sound that plays in moody situations. Moodiness increases when blocks around the player are at both sky and block light level zero, and decreases otherwise.

The moodiness calculation happens once per tick, and after reaching a certain value, the ambient mood sound is played.

See Mood sound.
additions_sound Optional TAG_Compound Additional ambient sound that has a chance of playing randomly every tick. See Additions sound.
music Optional TAG_Compound Music properties for the biome. See Music.

Particle

Name Type Meaning Values
options TAG_Compound Particle type and related options. See Particle options.
probability TAG_Float The chance for the particle to be spawned. Ambient particles are attempted to be spawned multiple times every tick. The default values vary between 0.0 and 1.0.

Particle options

Huh.png The following information needs to be added to this page:
The extra data specified in the Particle definitions is missing information to allow the particle to be successfully serialized as NBT.
Is it here the best place to define them, or somewhere else?
Name Type Meaning Values
type TAG_String The name of the particle. See protocol particle data.
value Optional Varies Any necessary extra data to fully define the particle. See protocol particle data.

Ambient sound

Name Type Meaning Values
sound_id TAG_String The ID of a soundtrack Example: "minecraft:ambient.basalt_deltas.loop"
range Optional TAG_Float The range of the sound. If not specified, the volume is used to calculate the effective range.

Mood sound

Name Type Meaning Values
sound TAG_String The ID of a soundtrack. Example: "minecraft:ambient.basalt_deltas.mood"
tick_delay TAG_Int Defines the rate at which the moodiness increase, and also the minimum time between plays. The default value is always 6000.
block_search_extent TAG_Int The radius used for the block search around the player during moodiness calculation. The default value is always 8.
offset TAG_Double The distance offset from the player when playing the sound.

The sound plays in the direction of the selected block during moodiness calculation, and is magnified by the offset.

The default value is always 2.0.

Additions sound

Name Type Meaning Values
sound TAG_String The ID of a soundtrack. Example: "minecraft:ambient.basalt_deltas.additions"
tick_chance TAG_Double The chance of the sound playing during the tick. The default value is always 0.0111.

Music

Name Type Meaning Values
sound TAG_String The ID of a soundtrack. Example: "minecraft:music.nether.basalt_deltas"
min_delay TAG_Int The minimum time in ticks since the last music finished for this music to be able to play. The default value is always 12000.
max_delay TAG_Int The maximum time in ticks since the last music finished for this music to be able to play. The default value is always 24000.
replace_current_music TAG_Byte Whether this music can replace the current one. 1: true, 0: false.

Chat Type

The minecraft:chat_type registry.

Name Type Meaning Values
chat TAG_Compound The chat decoration. See Decoration.
narration TAG_Compound The narration decoration. See Decoration.

Decoration

Name Type Meaning Values
translation_key TAG_String <tba> <tba>
style Optional TAG_Compound <tba> Similar to Chat JSON (only present in "chat" TAG_Compound)
parameters TAG_List of TAG_String <tba> Values can be "sender", "target" and "content"

Damage Type

The minecraft:damage_type registry.

Name Type Meaning Values
message_id TAG_String <tba> <tba>
scaling TAG_String <tba> <tba>
exhaustion TAG_Float <tba> <tba>
effects Optional TAG_String <tba> <tba>
death_message_type Optional TAG_String <tba> <tba>

Dimension Type

The minecraft:dimension_type registry. It defines the types of dimension that can be attributed to a world, along with all their characteristics.

Name Type Meaning Values
fixed_time Optional TAG_Long If set, the time of the day fixed to the specified value. Allowed values vary between 0 and 24000.
has_skylight TAG_Byte Whether the dimension has skylight access or not. 1: true, 0: false.
has_ceiling TAG_Byte Whether the dimension has a bedrock ceiling or not. When true, causes lava to spread faster. 1: true, 0: false.
ultrawarm TAG_Byte Whether the dimensions behaves like the nether (water evaporates and sponges dry) or not. Also causes lava to spread thinner. 1: true, 0: false.
natural TAG_Byte When false, compasses spin randomly. When true, nether portals can spawn zombified piglins. 1: true, 0: false.
coordinate_scale TAG_Double The multiplier applied to coordinates when traveling to the dimension. Allowed values vary between 1e-5 (0.00001) and 3e7 (30000000).
bed_works TAG_Byte Whether players can use a bed to sleep. 1: true, 0: false.
respawn_anchor_works TAG_Byte Whether players can charge and use respawn anchors. 1: true, 0: false.
min_y TAG_Int The minimum Y level. Allowed values vary between -2032 and 2031, and must also be a multiple of 16.

Warning.png min_y + height cannot exceed 2032.

height TAG_Int The maximum height. Allowed values vary between 16 and 4064, and must also be a multiple of 16.

Warning.png min_y + height cannot exceed 2032.

logical_height TAG_Int The maximum height to which chorus fruits and nether portals can bring players within this dimension. (Must be lower than height) Allowed values vary between 0 and 4064, and must also be a multiple of 16.

Warning.png logical_height cannot exceed the height.

infiniburn TAG_String A resource location defining what block tag to use for infiniburn. "#" or minecraft resource "#minecraft:...".
effects TAG_String Defines special dimensional effects, which includes:
  • Cloud level: Height at which clouds appear, if at all.
  • Sky type: Whether it's the normal sky with sun and moon; the low-visibility, foggy sky of the nether; or the static sky of the end.
  • Forced light map: Whether a bright light map is forced, siimilar to the night vision effect.
  • Constant ambient light: Whether blocks have shade on their faces.
Can be either:
  • minecraft:overworld, for clouds at 192, normal sky type, normal light map and normal ambient light.
  • minecraft:the_nether, for no clouds, nether sky type, normal light map and constant ambient light.
  • minecraft:the_end, for no clouds, end sky type, forced light map and normal ambient light.
ambient_light TAG_Float How much light the dimension has. Used as interpolation factor when calculating the brightness generated from sky light. The default values are 0.0 and 0.1, 0.1 for the nether and 0.0 for the other dimensions.
piglin_safe TAG_Byte Whether piglins shake and transform to zombified piglins. 1: true, 0: false.
has_raids TAG_Byte Whether players with the Bad Omen effect can cause a raid. 1: true, 0: false.
monster_spawn_light_level TAG_Int or TAG_Compound During a monster spawn attempt, this is the maximum allowed light level for it to succeed. It can be either a fixed value, or one of several types of distributions. Can be either:
monster_spawn_block_light_limit TAG_Int Maximum allowed block light level monster spawn attempts to happen. Allowed values vary between 0 and 15.

The default values are 0 and 15, 15 for the nether (where monsters can spawn anywhere) and 0 for other dimensions (where monsters can only spawn naturally in complete darkness).

Integer distribution

Integer providers can be either declared as constants with a TAG_Int, or in a structured TAG_Compounds for specific distribution types. For the latter, the following format is used.

Huh.png The following information needs to be added to this page:
The use for integer distributions described in the previous section pertains to monster spawning mechanisms, which is server-sided operation. The values received in the monster_spawn_light_level field have no noticeable impact on the client whatsoever. Should they even be described here?
Name Type Meaning Values
type TAG_String The type of distribution. Can be either:
  • minecraft:constant, for constant values, similarly to when declared as a TAG_Int.
  • minectaft:uniform, for uniformly distributed values between the specified range.
  • minecraft:biased_to_bottom, for values biased towards the lower end, between the specified range.
  • minecraft:clamped, for uniformly distributed values, clamped inside a range.
  • minecraft:weighted_list, for a weighted list of multiple distributions.
  • minecraft:clamped_normal, for normally distributed values, clamped inside a range.
value TAG_Compound Extra data pertaining to the type of distribution. Depends on the type of distribution.

Default Registries

The default registries in the JSON format is available for the following versions: