Add Minecraft PC 26.2 data (protocol 776) - #1298
Conversation
|
Live-tested this against a real vanilla 26.2 server (official Mojang server.jar, protocol 776, offline mode, verified sha1). Protocol-level test (
mineflayer: With those two bumped locally, I also hit 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. |
|
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. |
|
#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 |
6984fad to
94e25b2
Compare
|
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>
1e4ed9e to
916adae
Compare
|
Done — rebased onto One thing worth flagging from the rebase: Full test suite still green post-rebase: 1887 passing, 1 pending, 0 failing. |
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
left a comment
There was a problem hiding this comment.
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.
| "stinger_count", | ||
| "sleeping_pos", | ||
| "mob_flags", | ||
| "size", |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
…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>
|
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:
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. |
…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>
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>
| - trial_spawner_detection | ||
| - trial_spawner_detection_ominous |
There was a problem hiding this comment.
Backport to prev relevant versions or preserve old naming
|
Heads-up: 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 |
…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>
|
Merging into 26.2 branch to remove PR congestion |
|
One remaining follow-up for Vanilla 26.2's 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. |
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:
data/pc/26.2/*.jsonfiles (blocks, items, entities, recipes, commands, loot tables, language, protocol.json regenerated from proto.yml, etc.), taken verbatim from [Java] Fill data gaps from vanilla sources: 26.2, 1.13.1 palettes, 1.14.2, windows, commands, 1.9.1 #1287, sourced there from Mojang's 26.2 data generator reports/decompiled sources and cross-checked against a third-party extraction.data/pc/1.20.3/windows.json(new file, also from [Java] Fill data gaps from vanilla sources: 26.2, 1.13.1 palettes, 1.14.2, windows, commands, 1.9.1 #1287) adding thecrafter_3x3menu that's been missing fromwindows.jsonsince 1.20.3, so 26.2'swindowsdataPath entry is accurate instead of falling back to the stale 1.16.1 file.data/pc/latest/proto.ymlbumped from 26.1 to 26.2 with the 8 wire-format diffs (sessionId, onlineMode, team packet reorder, spectator_action rename, sulfur_cube slot component, particle registry additions, etc.).data/dataPaths.json,data/pc/common/versions.json,README.md.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/instrumentsare borrowed from 26.1 since those registries are unchanged in 26.2 (per #1287's own notes).Test plan
npm testintools/js(mocha + ajv schema validation): 1887 passing, 1 pending, 0 failingnpm run lint(standard): clean