Skip to content

Add Minecraft PC 26.2 data (protocol 776) - #1298

Merged
extremeheat merged 4 commits into
PrismarineJS:pc_26_2from
DallasCarraher:pc-26.2-support
Sep 19, 2026
Merged

extremeheat merged 4 commits into
PrismarineJS:pc_26_2from
DallasCarraher:pc-26.2-support

Conversation

@DallasCarraher

@DallasCarraher DallasCarraher commented Sep 14, 2026 •

Copy link
Copy Markdown

Summary

Registers Minecraft PC 26.2 (protocol 776), closing the gap tracked in #1197 and the stalled scaffold in #1219.

This is the 26.2-specific slice of #1287, pulled out so it can be reviewed and merged on its own:

Deliberately not included from #1287: the unrelated 1.13.1/1.14.2/1.9.1 fixes and the broader commands.json refresh for older already-released versions — those are separate concerns better reviewed on their own.

effects/enchantments/instruments are borrowed from 26.1 since those registries are unchanged in 26.2 (per #1287's own notes).

Test plan

  • npm test in tools/js (mocha + ajv schema validation): 1887 passing, 1 pending, 0 failing
  • npm run lint (standard): clean
  • Live-tested against a real 26.2 server with mineflayer/node-minecraft-protocol

@DallasCarraher

Copy link
Copy Markdown
Author

Live-tested this against a real vanilla 26.2 server (official Mojang server.jar, protocol 776, offline mode, verified sha1).

Protocol-level test (minecraft-protocol, using this branch's data via a node-minecraft-data submodule swap):

  • TCP connect → login → 82 packets parsed, including a full chunk packet → 0 parse errors.
  • Confirms protocol.json correctly decodes the real 26.2 wire format end to end.

mineflayer:
mineflayer@latest and prismarine-chunk@latest both hardcode their own per-major-version allowlists independent of minecraft-data (lib/version.js's testedVersions, and chunkImplementations.pc in prismarine-chunk). Both needed a one-line 26.2 entry (aliased to the same 1.18-family chunk impl 26.1 uses, since nothing in this PR changes the chunk section format) before mineflayer would even attempt a connection — expected, unrelated follow-up PRs in those repos once this lands.

With those two bumped locally, I also hit prismarine-physics@1.11.1 throwing No liquid gravity settings, have you made sure the liquid gravity features are up to date? — but this isn't 26.2-specific: independentLiquidGravity/proportionalLiquidGravity aren't defined in features.json for any version on current master, so this reproduces identically on 26.1 or 1.21.11 with the currently published prismarine-physics. Pre-existing cross-repo gap, not something this PR needs to fix.

Summary: the actual minecraft-data changes in this PR check out against a live server. The mineflayer-side blockers are separate, expected follow-ups in sibling repos.

@DallasCarraher

Copy link
Copy Markdown
Author

Update: getting this working end-to-end against a real mineflayer bot (pathfinder, collectblock, pvp, tool, armor-manager) surfaced four downstream gaps in sibling repos — none blocking this PR itself, but each needed for a full 26.2 bot to actually work once this data lands. Opened fixes for all of them, each independently tested against this branch:

With all four applied locally on top of this branch: mineflayer's internal test suite passes 39/39 (1 pending) for 26.2, node-minecraft-protocol's full suite passes 6787/6789 (2 pre-existing unrelated failures, zero attributable to 26.2), and a live bot with the full plugin stack spawned and pathfound successfully against a real vanilla 26.2 server.

@extremeheat

Copy link
Copy Markdown
Member

#1219 isn't stalled, it's the automatically generated boilerplate for supporting new version. One branch allows multiple people to work toward it vs needing one large PR. We can merge PRs toward that branch as there already PRs testing against it in node-minecraft-protocol and mineflayer CI wise

So we can likely point this PR against pc_26_2 branch

@extremeheat
extremeheat changed the base branch from master to pc_26_2 September 14, 2026 08:50
@extremeheat

extremeheat commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

I updated pc_26_2 branch to latest master

Can you rebase this on that branch/cherry pick commits on new checkout of that branch to resolve conflict? Thanks

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 PrismarineJS#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>
@DallasCarraher

DallasCarraher commented Sep 14, 2026 •

Copy link
Copy Markdown
Author

Done — rebased onto pc_26_2 and retargeted this PR's base branch there. Force-pushed the same branch rather than opening a new PR, so the history/comments stay put.

One thing worth flagging from the rebase: pc_26_2's scaffold protocol.json had the same sessionId/onlineMode fields already patched in (nice, matches what I'd found independently), but it's otherwise still the stale copy-of-26.1 scaffold — missing the other wire changes this PR adds (team packet reorder, spectator_action rename, sulfur_cube slot component, particle registry additions, etc.), all diffed against the real 26.2 sources and live-tested against a vanilla server. Since the two files overlapped on the same lines, git flagged it as a conflict rather than merging cleanly — resolved by taking this PR's complete protocol.json wholesale. Also had to deduplicate a leftover second "26.2" key in dataPaths.json that the auto-merge produced (one from the scaffold's minimal entry, one from this PR's full one) — kept this PR's complete entry.

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

Comment thread data/pc/latest/proto.yml
Comment thread data/pc/latest/proto.yml Outdated
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
  PrismarineJS#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 PrismarineJS#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>

@VasilisDragon VasilisDragon left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

AI agent review — manually approved by Vasilis.

Reviewed 3833a145 against the PR base. Checked the changed protocol definitions and data against hash-verified vanilla 26.2 artifacts, executed selected vanilla codecs, and compared baseline/candidate decoding, encoding and loader output. The inline findings cover two wire-format issues and three entity/attribute data corrections. The earlier ItemStackTemplate concern is addressed at this revision.

Generation produced no drift, including a repeated candidate build. Existing tooling and packet tests retained failures reproduced on the base. Interpreted codec diagnostics needed a separate adapter for an existing NBT-registration typo. No live vanilla server testing was performed, and the selected cycle tests had no recorded packets.

Comment thread data/pc/latest/proto.yml Outdated
Comment thread data/pc/latest/proto.yml Outdated
"stinger_count",
"sleeping_pos",
"mob_flags",
"size",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

AI agent review — manually approved by Vasilis.

These metadata keys need the new inherited fields. In 26.2, AbstractCubeMob extends AgeableMob, whose accessors occupy IDs 16 (baby) and 17 (age_locked). size moves to 18. SulfurCube then allocates max_fuse at 19 and from_bucket at 20.

Currently, a size update at ID 18 maps to max_fuse for sulfur_cube and has no metadata key for slime or magma_cube. Please update all three entries, preserving the accessor allocation order.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Confirmed and fixed. Decompiled the accessor definition order directly: AgeableMob.<clinit> defines DATA_BABY_ID then AGE_LOCKED (both booleans, indices 16/17 after the 16 inherited from Entity/LivingEntity/Mob), AbstractCubeMob.<clinit> defines one ID_SIZE (int, index 18), and SulfurCube.<clinit> defines MAX_FUSE (int) then FROM_BUCKET (boolean) — indices 19/20, in that order.

slime and magma_cube were missing baby/age_locked entirely, and sulfur_cube had from_bucket/max_fuse both mis-positioned and swapped. Fixed all three to ..., mob_flags, baby, age_locked, size, max_fuse, from_bucket. Pushed in 2003e22.

Comment thread data/pc/26.2/entities.json Outdated
Comment thread data/pc/26.2/attributes.json Outdated
…ng, 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
  PrismarineJS#1273's 1.21.2+ layout fix (dx/dy/dz, f32 yaw/pitch,
  PositionUpdateRelatives flags) the same way it dropped PrismarineJS#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>
@DallasCarraher

Copy link
Copy Markdown
Author

Addressed all five findings from the latest review (2003e22) — verified each independently by decompiling the real 26.2 server jar with CFR before fixing, rather than taking the review at face value:

  1. packet_entity_teleport — the pc_26_2 rebase had also silently dropped pc/protocol: entity_teleport layout for 1.21.2+ (velocity, f32 rotation, relative flags) #1273's 1.21.2+ layout fix (same failure mode as the ItemStackTemplate regression from the last round). Restored; now matches packet_position's layout field-for-field, as expected.
  2. packet_spectator_action.entityId — confirmed vanilla's OPTIONAL_VAR_INT is a raw sentinel varint with no presence byte, not protodef's standard option. Changed to optvarint (the existing alias already used for this exact pattern elsewhere).
  3. entities.json slime/magma_cube/sulfur_cube — confirmed via SynchedEntityData.defineId call order in AgeableMob/AbstractCubeMob/SulfurCube bytecode. Added missing baby/age_locked, fixed sulfur_cube's swapped max_fuse/from_bucket.
  4. bee dimensions — confirmed EntityTypes.BEE.sized(0.55f, 0.5f); was still 26.1's 0.7/0.6.
  5. knockbackResistance attribute min — confirmed RangedAttribute(0.0, -2.0, 1.0); was 0.0.

Full test suite green throughout (1887 passing, 1 pending, 0 failing), and re-verified live connectivity against a real 26.2 server after each round of fixes.

DallasCarraher added a commit to DallasCarraher/minecraft-companion-bot that referenced this pull request Sep 15, 2026
…parsing, and a scenario cost test

- OpenAIProvider now accepts a baseURL/name override so it can target OpenRouter's
  Chat-Completions-compatible endpoint (LLM_PROVIDER=openrouter) without a new client.
- Pin MINECRAFT_VERSION=26.2 via a local yalc override of minecraft-data pending
  PrismarineJS/minecraft-data#1298; document the override and drop-once-merged plan in .env.example.
- Fix bot.once('kicked', ...) to parse modern JSON chat-component kick reasons instead of
  collapsing them to "[object Object]" (src/mineflayer/kickReason.ts).
- Note the required node-minecraft-protocol#1530 local patch for realm+microsoft connections.
- Add a scenario cost test (tests/unit/llm/scenarioCost.test.ts) that runs a real decision tick
  end-to-end and estimates Haiku 4.5 $ cost, to catch order-of-magnitude regressions in tool-schema
  overhead as skills are added.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
DallasCarraher added a commit to DallasCarraher/minecraft-data that referenced this pull request Sep 16, 2026
Two independent gaps found live-testing 26.3 against a real Realm with
mineflayer:

- packet_success (login, toClient) was missing the sessionId: UUID
  field that 26.2 (protocol 776) already added. Client-side parsing
  under-read every login success packet by 16 bytes.

- configuration.toClient's packet ID table was missing
  CLIENTBOUND_POST_EFFECTS at 0x0a, shifting every packet from
  store_cookie (0x0b) through code_of_conduct (0x14) down by one slot
  versus the real server. Confirmed by decompiling
  net.minecraft.network.protocol.configuration.ConfigurationProtocols
  from the official 26.3 server jar and reading addPacket() call order
  (same technique as PrismarineJS#1298/26.1.2's packet ID fixes). Concretely, ID
  0x0f was mapped to custom_report_details but is actually
  select_known_packs — since mineflayer's client.once('select_known_packs')
  listener never fired under the wrong name, the client never sent the
  required response, and the server silently stalled in the
  configuration state forever (steady keep_alive, nothing else).

Added packet_post_effects (a single postEffects: List<Identifier>
field, confirmed via javap on ClientboundPostEffectsPacket's
STREAM_CODEC) and resequenced 0x0a-0x14 to match.

With both fixes, a real client now completes the full configuration
handshake (select_known_packs -> registry_data -> tags ->
finish_configuration) and enters the play state.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Comment thread data/pc/latest/proto.yml Outdated
Comment on lines +1031 to +1032
- trial_spawner_detection
- trial_spawner_detection_ominous

@extremeheat extremeheat Sep 16, 2026 •

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.

Backport to prev relevant versions or preserve old naming

@Pix3lPirat3

Copy link
Copy Markdown
Contributor

Heads-up: data/pc/26.2/blocks.json here has material: incorrect_for_wooden_tool on 108 blocks (ores, obsidian, metal blocks), which makes prismarine-block digTime() ~8x too slow for them - the bug #1307 fixes for 1.20.5-26.1.

It comes from PrismarineJS/minecraft-data-generator#77's 26.2 module lacking the fix from PrismarineJS/minecraft-data-generator#86. Regenerating once that lands, or applying the same incorrect_for_wooden_tool -> mineable/pickaxe mapping to those 108 blocks, would keep 26.2 from regressing.

…aterial 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 PrismarineJS#1307 for 1.20.5-26.1 so 26.2 doesn't regress.

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

Copy link
Copy Markdown
Member

Merging into 26.2 branch to remove PR congestion

@extremeheat
extremeheat merged commit 68ea7b5 into PrismarineJS:pc_26_2 Sep 19, 2026
2 checks passed

Copy link
Copy Markdown

One remaining follow-up for pc_26_2: could we regenerate the embedded login registries from 26.2? loginPacket.json is unchanged from 2003e226, which I tested in the earlier review.

Vanilla 26.2's Enchantment.DIRECT_CODEC rejects eight entries: bane_of_arthropods, channeling, impaling, looting, lunge, power, punch and smite. They still use older entity-predicate structures. For bane_of_arthropods, changing just the two predicate keys from type to minecraft:entity_type makes it decode and match the official resource. The other entries need their current structures too. Source: EntityPredicate and registered subpredicate names.

All 43 official enchantment resources passed the same harness and registry context. This is inherited stale data, not a regression from the latest fixes. NMP uses these registries by default for servers; these were native-codec checks, not a live vanilla-client connection.

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.

4 participants