Skip to content

Add bedrock 1.26.0 protocol data #31

@extremeheat

Description

@extremeheat

Minecraft bedrock was updated to 1.26.0 from 1.21.130. We need to update the protocol schema files that we have for this new version.

Information on our YAML-like schema files are doc'ed in https://github.com/PrismarineJS/minecraft-data/blob/master/doc/protocol.md

Specific changes we need to make are listed below via gemini:

Here are the changes required to update the protocol schemas to **v1.26.0**.

### `proto.yml`

**1. Update Version**
```yaml
!version: 1.26.0
```

**2. Update `packet_book_edit`**
The types have changed from bytes to VarInts (signed) and VarUInts (unsigned), and the order/types of fields inside the switch logic should be updated to match the Gophertunnel patch (Varint32 -> zigzag32, Varuint32 -> varint).

```yaml
packet_book_edit:
   !id: 0x61
   !bound: server
   inventory_slot: zigzag32
   type: varint =>
      0: replace_page
      1: add_page
      2: delete_page
      3: swap_pages
      4: sign
   _: type?
      if replace_page or add_page:
         page_number: zigzag32
         text: string
         # Only available on Education Edition.
         photo_name: string
      if delete_page:
         page_number: zigzag32
      if swap_pages:
         page1: zigzag32
         page2: zigzag32
      if sign:
         title: string
         author: string
         xuid: string
```

**3. Update `packet_text`**
Remove the category validation strings (the `_: category ?` block is removed entirely in the patch).

```yaml
packet_text:
   !id: 0x09
   !bound: both
   # NeedsTranslation specifies if any of the messages need to be translated.
   needs_translation: bool
   category: u8 =>
      0: message_only
      1: authored
      2: parameters
   # TextType is the type of the text sent.
   type: u8 =>
# ... (rest of packet_text remains the same)
```

**4. Update `packet_start_game`**
The ID strings were removed from the middle and moved to the end (inside `ServerTelemetryData` which is flattened). New optional `ServerJoinInformation` added near the end.

```yaml
packet_start_game:
   # ... (previous fields)
   disable_player_interactions: bool
   # REMOVED: server_identifier, world_identifier, scenario_identifier, owner_identifier
   # A base64 encoded world ID that is used to identify the world.
   level_id: string
   # ... (middle fields remain the same) ...
   block_network_ids_are_hashes: bool
   server_controlled_sound: bool
   # New fields 1.26.0
   has_server_join_info: bool
   server_join_info: has_server_join_info ?
      if true: ServerJoinInformation
   server_identifier: string
   scenario_identifier: string
   world_identifier: string
   owner_identifier: string
```

**5. Update `packet_set_player_inventory_options`**
Update the enums for `layout` and `crafting_layout`.

```yaml
packet_set_player_inventory_options:
   !id: 0x133
   # ... left_tab / right_tab ...
   filtering: bool
   layout: zigzag32 =>
      0: none
      1: inventory_only
      2: default
      3: recipe_book_only
   crafting_layout: zigzag32 =>
      0: none
      1: inventory_only
      2: default
      3: recipe_book_only
```

**6. Update `packet_camera_aim_assist_presets`**
Add `entity_type_families` to categories and `entity_type_family_exclusions` to presets.

```yaml
packet_camera_aim_assist_presets:
   !id: 0x140
   !bound: client
   # CategoryGroups is a list of groups of categories which can be referenced by one of the Presets.
   categories: []varint
      # Identifier is the unique identifier of the group.
      name: string
      # Priorities represents the block and entity specific priorities for targetting.
      entity_priorities: []varint
         id: string
         priority: li32
      block_priorities: []varint
         id: string
         priority: li32
      block_tags: varint[]varint
      entity_type_families: []varint
         id: string
         priority: li32
      entity_default?: li32
      block_default?: li32
   presets: []varint
      id: string
      exclusion_settings:
         blocks: string[]varint
         entities: string[]varint
         block_tags: string[]varint
         entity_type_families: string[]varint
      target_liquids: string[]varint
      item_settings: []varint
# ... (rest remains same)
```

**7. Update `packet_graphics_override_parameter`**
Add `float_value` and `vec3_value` before the biome identifier.

```yaml
packet_graphics_override_parameter:
   !id: 0x14b
   !bound: client
   values: ParameterKeyframeValue[]varint
   float_value: lf32
   vec3_value: vec3f
   biome_identifier: string
   parameter_type: GraphicsOverrideParameterType
   reset: bool
```

**8. Update `packet_serverbound_diagnostics`**
Add `memory_category_values`.

```yaml
packet_serverbound_diagnostics:
   !id: 0x13B
   !bound: server
   average_frames_per_second: lf32
   average_server_sim_tick_time: lf32
   average_client_sim_tick_time: lf32
   average_begin_frame_time: lf32
   average_input_time: lf32
   average_render_time: lf32
   average_end_frame_time: lf32
   average_remainder_time_percent: lf32
   average_unaccounted_time_percent: lf32
   memory_category_values: MemoryCategoryCounter[]varint
```

**9. Add New Packets**
Add these to the end of `proto.yml`. IDs continue from `0x14c`.

```yaml
packet_clientbound_data_driven_ui_show_screen:
   !id: 0x14d
   !bound: client
   screen_id: string

packet_clientbound_data_driven_ui_close_all_screens:
   !id: 0x14e
   !bound: client

packet_clientbound_data_driven_ui_reload:
   !id: 0x14f
   !bound: client

packet_clientbound_texture_shift:
   !id: 0x150
   !bound: client
   action: u8 =>
      0: invalid
      1: initialize
      2: start
      3: set_enabled
      4: sync
   collection_name: string
   from_step: string
   to_step: string
   all_steps: string[]varint
   current_length_ticks: varint64
   total_length_ticks: varint64
   enabled: bool

packet_voxel_shapes:
   !id: 0x151
   !bound: client
   shapes: VoxelShape[]varint
   name_map: VoxelShapeNameEntry[]varint

packet_camera_spline:
   !id: 0x152
   !bound: client
   splines: CameraSplineDefinition[]varint

packet_camera_aim_assist_actor_priority:
   !id: 0x153
   !bound: client
   priority_data: CameraAimAssistActorPriorityData[]varint
```

---

### `types.yml`

**1. Update `BiomeChunkGeneration`**
Add `village_type`.

```yaml
BiomeChunkGeneration:
   # ... (previous fields)
   replacements_data?: BiomeReplacementData[]varint
   has_village_type: bool
   village_type: has_village_type ?
      if true: u8
```

**2. Update `CameraSplineInstruction`**
Replace `ease_type` with `spline_type` (optional) and update keyframe type.

```yaml
CameraSplineInstruction:
   total_time: lf32
   has_spline_type: bool
   spline_type: has_spline_type ?
      if true: u8
   curve: vec3f[]varint
   progress_key_frames: CameraProgressOption[]varint
   rotation_options: CameraRotationOption[]varint
```

**3. Add New Types**

```yaml
CameraProgressOption:
   value: lf32
   time: lf32
   has_ease_type: bool
   ease_type: has_ease_type ?
      if true: u8

CameraSplineDefinition:
   name: string
   instruction: CameraSplineInstruction

CameraAimAssistActorPriorityData:
   preset_index: li32
   category_index: li32
   actor_index: li32
   priority: li32

MemoryCategoryCounter:
   category: u8
   bytes: lu64

VoxelCells:
   x_size: u8
   y_size: u8
   z_size: u8
   storage: u8[]varint

VoxelShape:
   cells: VoxelCells
   x_coordinates: lf32[]varint
   y_coordinates: lf32[]varint
   z_coordinates: lf32[]varint

VoxelShapeNameEntry:
   name: string
   id: lu16

GatheringJoinInfo:
   experience_id: string
   experience_name: string
   experience_world_id: string
   experience_world_name: string
   creator_id: string
   store_id: string

ServerJoinInformation:
   has_gathering_info: bool
   gathering_info: has_gathering_info ?
      if true: GatheringJoinInfo
```

**4. Update `CameraRotationOption`**
Add optional `ease_type`.

```yaml
CameraRotationOption:
   value: vec3f
   time: lf32
   has_ease_type: bool
   ease_type: has_ease_type ?
      if true: u8
```

**5. Update `MetadataDictionary`**
Add new keys at the end. Note: Gophertunnel uses `r.String` for these.

```yaml
MetadataDictionary: []varint
   key: varint =>
      # ... previous keys ...
      135: seat_camera_relax_distance_smoothing
      136: aim_assist_priority_preset_id
      137: aim_assist_priority_category_id
      138: aim_assist_priority_actor_id
   # ...
   value: key ?
      # ... previous switches ...
      if aim_assist_priority_preset_id or aim_assist_priority_category_id or aim_assist_priority_actor_id: string
      # ... default logic ...
```

**6. Update `GraphicsOverrideParameterType`**
Add new types.

```yaml
GraphicsOverrideParameterType: u8 =>
   - sky_zenith_color
   - sky_horizon_color
   - horizon_blend_min
   - horizon_blend_max
   - horizon_blend_start
   - horizon_blend_mie_start
   - rayleigh_strength
   - sun_mie_strength
   - moon_mie_strength
   - sun_glare_shape
   - chlorophyll
   - cdom
   - suspended_sediment
   - waves_depth
   - waves_frequency
   - waves_frequency_scaling
   - waves_speed
   - waves_speed_scaling
   - waves_shape
   - waves_octaves
   - waves_mix
   - waves_pull
   - waves_direction_increment
   - midtones_contrast
   - highlights_contrast
   - shadows_contrast
```

**7. Update `SoundType`**
Append new sounds to the end of the list.

```yaml
SoundType: varint =>
   # ...
   - ItemWoodenSpearUse
   - SaddleInWater
   - ItemStoneSpearAttackHit
   - ItemIronSpearAttackHit
   - ItemCopperSpearAttackHit
   - ItemGoldenSpearAttackHit
   - ItemDiamondSpearAttackHit
   - ItemNetheriteSpearAttackHit
   - ItemStoneSpearAttackMiss
   - ItemIronSpearAttackMiss
   - ItemCopperSpearAttackMiss
   - ItemGoldenSpearAttackMiss
   - ItemDiamondSpearAttackMiss
   - ItemNetheriteSpearAttackMiss
   - ItemStoneSpearUse
   - ItemIronSpearUse
   - ItemCopperSpearUse
   - ItemGoldenSpearUse
   - ItemDiamondSpearUse
   - ItemNetheriteSpearUse
```

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions