Skip to content

🎈 Add Minecraft pc 26.2 data - #1219

Open
rom1504bot wants to merge 5 commits into
masterfrom
pc_26_2
Open

rom1504bot wants to merge 5 commits into
masterfrom
pc_26_2

Conversation

@rom1504bot

@rom1504bot rom1504bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Collaborator

This automated PR sets up the relevant boilerplate for Minecraft pc version 26.2. Fixes #1218.

Related:

  • You can help contribute to this PR by opening a PR against this pc_26_2 branch instead of master.

@extremeheat

Copy link
Copy Markdown
Member

@copilot please re-add the changes made in #1216 to this updated PR for 26.2 and also correctly update the YAML files

Copilot AI commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@copilot please re-add the changes made in #1216 to this updated PR for 26.2 and also correctly update the YAML files

Addressed in 4dd8762. The 26.2 login field fixes from #1216 are re-applied in data/pc/latest/proto.yml, and data/pc/26.2/protocol.json was regenerated from that YAML source.

@perceiveing

Copy link
Copy Markdown

Heads up — the generated data/pc/26.2/protocol.json in this PR is missing two wire changes that are present in the 26.2 server jar. Both look like the extractor carrying 26.1 definitions forward.

I verified this by decompiling the 26.1 and 26.2 server jars (26.x ships deobfuscated, so no mappings needed) and diffing the whole net/minecraft/network/ tree. Fifteen files differ; eleven are refactors with no wire effect. Four are real. This PR has two of them (packet_success / sessionId and packet_login / onlineMode — both correct, and I confirmed onlineMode is placed correctly between commonPlayerSpawnInfo and enforcesSecureChat). The other two are missing.

1. packet_teams — Parameters is fully reordered

ClientboundSetPlayerTeamPacket.Parameters became a record with a StreamCodec in 26.2, and the field order changed:

# 26.1 26.2
1 displayName displayName
2 options (byte) playerPrefix
3 nametagVisibility playerSuffix
4 collisionRule nameTagVisibility
5 color — varint ChatFormatting ordinal collisionRule
6 playerPrefix color — Optional<TeamColor>
7 playerSuffix options (byte)

26.2 source:

public record Parameters(
   Component displayName, Component playerPrefix, Component playerSuffix,
   Team.Visibility nameTagVisibility, Team.CollisionRule collisionRule,
   Optional<TeamColor> color, @PlayerTeam.OptionFlags byte options
) {
   public static final StreamCodec<RegistryFriendlyByteBuf, Parameters> STREAM_CODEC = StreamCodec.composite(
      ComponentSerialization.TRUSTED_STREAM_CODEC, Parameters::displayName,
      ComponentSerialization.TRUSTED_STREAM_CODEC, Parameters::playerPrefix,
      ComponentSerialization.TRUSTED_STREAM_CODEC, Parameters::playerSuffix,
      Team.Visibility.STREAM_CODEC,               Parameters::nameTagVisibility,
      Team.CollisionRule.STREAM_CODEC,            Parameters::collisionRule,
      ByteBufCodecs.optional(TeamColor.STREAM_CODEC), Parameters::color,
      ByteBufCodecs.BYTE,                         Parameters::options,
      Parameters::new
   );
}

Two things beyond the reorder:

  • options moves from slot 2 to slot 7, and prefix/suffix move from the tail to slots 2–3.
  • color is now Optional<TeamColor> — a bool prefix followed by the varint if present. The domain also narrows: 26.1 wrote a ChatFormatting ordinal (0–21, with 21 = RESET meaning "no color"), whereas TeamColor is 0–15 and absence is carried by the Optional instead. TeamColor.STREAM_CODEC is ByteBufCodecs.idMapper(BY_ID, v -> v.id), so plain varint.

The current definition in this PR is still the 26.1 layout (name, flags, nameTagVisibility, collisionRule, formatting, prefix, suffix), so it will desync on the first team packet a 26.2 server sends. Worth noting this is the failure mode that parses "successfully" into wrong fields rather than throwing, so it may not show up in a connect-and-spawn smoke test.

2. spectate_entity replaced by spectator_action

- .addPacket(GamePacketTypes.SERVERBOUND_SPECTATE_ENTITY, ServerboundSpectateEntityPacket.STREAM_CODEC)
+ .addPacket(GamePacketTypes.SERVERBOUND_SPECTATOR_ACTION, ServerboundSpectatorActionPacket.STREAM_CODEC)
public record ServerboundSpectatorActionPacket(OptionalInt spectateEntityId) {
   public static final StreamCodec<ByteBuf, ServerboundSpectatorActionPacket> STREAM_CODEC =
      StreamCodec.composite(ByteBufCodecs.OPTIONAL_VAR_INT, ..., ServerboundSpectatorActionPacket::new);
}

ByteBufCodecs.VAR_INT → ByteBufCodecs.OPTIONAL_VAR_INT, and the packet is renamed. It occupies the same slot in GameProtocols, so packet IDs do not shift. This PR still has packet_spectate_entity: { entityId: varint }. Serverbound and rarely used, so low practical impact — but it is wrong.

Separately: the dataPaths.json aliases look unsafe for this version

This PR points blocks, items, entities, particles, sounds, attributes, biomes and recipes at pc/26.1. 26.2 is not registry-compatible with 26.1 — I ran the vanilla --reports generator on both jars and diffed all 95 registries:

registry 26.1 → 26.2 protocol IDs shifted
item 1506 → 1537 1480 of 1506
sound_event 1902 → 1968 1674
block 1168 → 1196 170
particle_type 117 → 125 113
block_type 263 → 265 104
game_event 60 → 61 51
attribute 35 → 40 all 35
data_component_type 110 → 111 32
entity_type 157 → 158 27
block_entity_type 49 → 49 23

26.2 adds a cinnabar/sulfur block family, a sulfur_cube entity, geyser/noxious-gas particles and five new attributes, all inserted mid-registry, which renumbers most of what follows. block_entity_type also removes minecraft:bed.

Block states matter most for chunk decoding: 29,873 → 32,366, and 5,186 state IDs that are valid in both versions name a different block. The first divergence is at 24687:

id 24687:  26.1 = calcite        ->  26.2 = sulfur
id 24688:  26.1 = tinted_glass   ->  26.2 = potent_sulfur
id 24689:  26.1 = powder_snow    ->  26.2 = potent_sulfur

Chunks would decode without error and report plausible-looking wrong blocks. Happy to open a PR against pc_26_2 with extracted 26.2 tables and the two protocol fixes above if that's useful.

One small correction while I'm here, in case it saves someone time: the global block-state palette for 26.2 needs 15 bits, not 17 — ceil(log2(32366)) = 15, same as 26.1. I mention it because PrismarineJS/prismarine-chunk#331 relaxes prismarine-chunk's bitsPerBlock > 16 guard on the stated basis that 26.x has "more than 65536 block states". It has 32,366, and with correct data maxBitsPerBlock computes to 15, so that guard should never legitimately fire. If it is firing in practice, the stale registry data above is a more likely cause than the bound.

Generated with Claude Code

extremeheat and others added 2 commits September 14, 2026 09:10
Co-authored-by: extremeheat <13713600+extremeheat@users.noreply.github.com>
* Add Minecraft PC 26.2 data

Registers protocol 776 (26.2) with real generated data: blocks, items,
entities, recipes, language, commands, protocol.json (regenerated from
proto.yml), loot tables, and the rest of the per-version files. Also
adds a 1.20.3 windows.json with the crafter menu (missing since 1.20.3)
so 26.2's windows entry is accurate.

Extracted from the 26.2 portion of #1287,
which additionally carries unrelated fixes for 1.13.1, 1.14.2, 1.9.1
and a broader commands.json refresh across older versions. This commit
isolates just the 26.2 data so it can be reviewed and merged
independently of that larger changeset.

effects/enchantments/instruments are borrowed from 26.1 since those
registries are unchanged in 26.2.

Full mocha suite passes (1887 passing, 1 pending, 0 failing).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Fix sulfur_cube_content type reuse; restore ItemStackTemplate regression

Addresses review feedback on this PR:

- sulfur_cube_content duplicated ItemStackTemplate's shape inline
  instead of referencing it. Verified against the real 26.2 server jar:
  net.minecraft.world.item.component.SulfurCubeContent is a record with
  a single field of type net.minecraft.world.item.ItemStackTemplate (no
  array wrapper) — Mojang's own internal type has the same name and
  shape minecraft-data already used. Now just `if sulfur_cube_content:
  ItemStackTemplate`.

- packet_spectator_action: verified this is a genuine rename, not a
  new packet alongside the old one. Decompiled the real 26.2 server
  jar: net/minecraft/network/protocol/game/ServerboundSpectatorActionPacket
  exists (a Record with one field, `OptionalInt spectateEntityId`,
  handled via `handleSpectatorAction`); no ServerboundSpectateEntityPacket
  class exists anywhere in the jar. Matches this PR's existing encoding
  (`entityId?: varint`) exactly — no data change needed for this one.

- Separately: rebasing this branch onto pc_26_2 silently regressed
  #1267's ItemStackTemplate fix throughout data/pc/latest/proto.yml —
  git's merge applied both sides' overlapping edits to this file in a
  way that dropped #1267's hunks without flagging a conflict. Restored
  all of it (intangible_projectile NBT, and ItemStackTemplate at
  use_remainder/charged_projectiles/bundle_contents/container/particle
  item/SlotDisplay item_stack/advancement icon) and regenerated
  data/pc/26.2/protocol.json from the corrected proto.yml.

Full test suite still green: 1887 passing, 1 pending, 0 failing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Address review findings: teleport regression, spectator_action encoding, cubemob metadata, bee size, knockback_resistance min

All five verified by decompiling the real 26.2 server jar
(versions/26.2/server-26.2.jar) with CFR, cross-referenced against
extremeheat/extracted_minecraft_data where cited in review.

- packet_entity_teleport: the pc_26_2 rebase also silently dropped
  #1273's 1.21.2+ layout fix (dx/dy/dz, f32 yaw/pitch,
  PositionUpdateRelatives flags) the same way it dropped #1267's
  ItemStackTemplate fix. Restored — ClientboundTeleportEntityPacket
  still uses PositionMoveRotation in 26.2, confirmed against the real
  class.

- packet_spectator_action: entityId?: varint (protodef presence-byte
  optional) doesn't match vanilla's wire format. Decompiled
  ByteBufCodecs.OPTIONAL_VAR_INT: it maps a single raw VarInt directly
  (no separate presence byte) — 0 = absent, n = entity id (n - 1).
  Changed to `entityId: optvarint`, the same sentinel-varint alias
  already used for entity metadata's optional_block_state/
  optional_unsigned_int.

- data/pc/26.2/entities.json: slime/magma_cube/sulfur_cube were
  missing the `baby`/`age_locked` metadata keys AgeableMob defines
  (confirmed via SynchedEntityData.defineId call order in
  AgeableMob/AbstractCubeMob/SulfurCube bytecode), and sulfur_cube had
  max_fuse/from_bucket swapped. Fixed all three to
  mob_flags, baby, age_locked, size, max_fuse, from_bucket.

- bee width/height: EntityTypes.BEE registers .sized(0.55f, 0.5f) in
  26.2; entities.json still had 26.1's 0.7/0.6. Fixed.

- data/pc/26.2/attributes.json: knockbackResistance's min was 0.0;
  Attributes.KNOCKBACK_RESISTANCE registers RangedAttribute(default
  0.0, min -2.0, max 1.0). Fixed.

Full test suite still green: 1887 passing, 1 pending, 0 failing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Address review: preserve trial_spawner particle naming, fix pickaxe material for 26.2

- Revert latest/proto.yml particle enum rename (trial_spawner_detection ->
  trial_spawner_detected_player) to match the naming still used by all
  other proto.yml versions, avoiding an inconsistent one-off rename scoped
  to this PR; regenerate 26.2/protocol.json to match.
- Fix 26.2/blocks.json: 108 ore/obsidian/metal blocks carried
  material: incorrect_for_wooden_tool instead of mineable/pickaxe, which
  made prismarine-block digTime() ~8x too slow for them. Apply the same
  mapping used by #1307 for 1.20.5-26.1 so 26.2 doesn't regress.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>

@rom1504 rom1504 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Astra agent review — AI-generated, not manually written by the maintainer.

Not ready to merge at 68ea7b5: Regenerate26.1 YAML/JSON consistently, restore data CI, then finish26.2 cross-module integration.

The older comments about teams ordering, optional team color, spectator_action, and the main registry aliases are addressed in the current source. I am not repeating those resolved findings. Full cross-module 26.2 integration still needs its normal version-branch checks.

Validation: current head and discussion rechecked; this review uses the source, CI and focused evidence collected for this same head earlier today. No additional full-suite run in this publication pass.

Skills used: prismarine-review reconciled the current code with existing feedback and validation; prismarine-protocol-data-review traced maintained schemas/generators through version selection and generated data.

Comment thread data/dataPaths.json
"tints": "pc/26.1",
"version": "pc/26.1",
"windows": "pc/1.16.1",
"proto": "pc/26.1"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Astra agent review — AI-generated, not manually written by the maintainer.

The new frozen 26.1 YAML selection is not synchronized with its generated JSON: current CI reports 26.1 (26.1) / protocol.json is desynced from yaml, please run npm run build (1,922 passing tests, one failure). Please regenerate the affected YAML/JSON pair and rerun validation before landing the 26.2 data.

Skills used: prismarine-review reconciled the current code with existing feedback and validation; prismarine-protocol-data-review traced maintained schemas/generators through version selection and generated data.

@0xmthan

0xmthan commented Oct 3, 2026

Copy link
Copy Markdown

The 26.1 desync is fixed in #1333 (targets pc_26_2): it merges master and copies master's 26.1 proto.yml (#1278, #1295) into pc/26.1/, then rebuilds. npm test passes locally (2067 passing). CI there needs approval to run.

japherwocky added a commit to japherwocky/minecraft-data that referenced this pull request Oct 4, 2026
The 26.3 branch freezes 26.1's yaml in pc/26.1/proto.yml (latest moved on),
but froze it on 2026-09-22; master's later 26.1 fixes went into
pc/latest/proto.yml and pc/26.1/protocol.json, so after the merge the json
and yaml disagreed and the 'protocol yaml' test failed -- the same failure
as PrismarineJS#1219. Took master's 26.1 yaml; npm run build then leaves every
protocol.json unchanged, 26.1's identical to master's.
u9g added a commit that referenced this pull request Oct 20, 2026
)

handleMcpcGeneratedArtifacts.js took the first open PR with 🎈 in its
title. With pc 26.2 (#1219) and 26.3 (#1300) both open, the 26.2 data
from minecraft-data-generator#77 was routed to the 26.3 PR and the run
failed with "Version 26.2 not found". Bedrock 🎈 PRs could be picked
the same way.

Pick the open PR whose head branch is pc_<version> (the branch
createInitialPR opens it from) instead.

Also compare CREATE_PR_IF_NONE against 'true': the workflow input
defaults to the string 'false', which is truthy, so the "create a PR if
none exists" path ran on every miss (e.g. the duplicate 1.21.11 PR
#1152). Now that a miss is per version, it would fire far more often.
@Cyverno

Cyverno commented Oct 22, 2026

Copy link
Copy Markdown

I opened #1339 against pc_26_2. It builds on #1333 and does a real merge of current master. It also fixes three things I found by checking the 26.2 data against the vanilla 26.2 jar and its --reports output:

  • the attribute mapper, which was missing the five new 26.2 attributes, so every key decoded as its neighbour
  • 1-based sound ids
  • loginPacket.json, which was 26.1's registries. It's now regenerated from a vanilla 26.2 server.

I also checked the packet ids, every registry-backed mapper, block states, items, entities and entity metadata, and they match vanilla. The details and the downstream test results (node-minecraft-protocol, mineflayer and a live Paper 26.2 smoke test) are in #1339. With it, the nmp and mineflayer pc26_2 branches pass their 26.2 suites without the debug protodef builds: PrismarineJS/node-minecraft-protocol#1550 and PrismarineJS/mineflayer#4192.

@extremeheat

Copy link
Copy Markdown
Member

@Cyverno I updated this PR with latest master ; can you please recreate your PR only with the changes ?

@Cyverno

Cyverno commented Oct 30, 2026

Copy link
Copy Markdown

Done: #1344 is against the current pc_26_2 and has only the 26.2 changes, plus a resync of data/pc/26.1/proto.yml with master so the yaml/json sync test passes on this branch. I also dropped the team_color rename, following the updated naming guidance.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Minecraft PC 26.1

9 participants