Skip to content

Fix ItemPredicate field name in advancement JSON causing item-specific advancements to fire for any item#1620

Merged
rubensworks merged 2 commits intomaster-1.21-ltsfrom
copilot/fix-tutorial-progression-errors
Feb 28, 2026
Merged

Fix ItemPredicate field name in advancement JSON causing item-specific advancements to fire for any item#1620
rubensworks merged 2 commits intomaster-1.21-ltsfrom
copilot/fix-tutorial-progression-errors

Conversation

Copy link
Contributor

Copilot AI commented Feb 28, 2026

Tutorial advancements using item-specific predicates (e.g. "Tool for Obsidian", and the IntegratedTunnels "Click with diamond sword") were triggering regardless of the actual item configured, because ItemPredicate.CODEC in 1.21 renamed the field from "item" to "items". The unrecognized field silently produced an empty predicate matching every itemstack.

Changes

  • advancement/challenges/tool_for_obsidian.json: Fix ItemPredicate field name from the old "item" to "items" so it correctly matches only minecraft:stone_pickaxe:

    - "item": "minecraft:stone_pickaxe"
    + "items": "minecraft:stone_pickaxe"
  • GameTestsAdvancements.java: Add assertAdvancementNotDone helper and a new testAdvancementToolForObsidianNegative game test that verifies the advancement does not trigger when the operator is constructed with bone_meal instead of stone_pickaxe.

Note on IntegratedTunnels

The same broken format exists in IntegratedTunnels' click_sword/click_sword.json (the originally reported advancement). The identical fix — changing "item": "minecraft:diamond_sword""items": "minecraft:diamond_sword" inside the ItemPredicate object — should be applied there as well.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/CyclopsMC/IntegratedTunnels/git/trees/master-1.21
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Progression errors for manual tutorial</issue_title>
<issue_description>

Issue type:

  • 🐛 Bug

Short description:

Created and placed in the world:
World Block Importer
World Block Exporter
World Item Importer
World Item Exporter
Player Simulator

Advancements in Tutorials / Tunnel Tutorials are still not fit:
Advancement "Click with diamond sword" is fit, but in reality I did not use diamond sword and clicked a sapling with bone meal

Image Image Image

Versions:

  • This mod: 1.31.0-1562
  • Minecraft: 1.21.1
  • Mod loader version: NeoForge 21.1.219

</issue_description>

<agent_instructions>Could you debug and fix this one?
As of recently, we have game tests for advancements, so please add a game test for this negative case of where the advancement should not be triggered.
After adding the game test, debug and fix it. (It's possible the root cause lies in the Integrated Dynamics codebase though, so in that case, please suggest a change in https://github.com/CyclopsMC/IntegratedDynamics/)</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@rubensworks

Thanks for reporting!


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…dd negative game test

Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix progression errors for manual tutorial Fix ItemPredicate field name in advancement JSON causing item-specific advancements to fire for any item Feb 28, 2026
@rubensworks rubensworks marked this pull request as ready for review February 28, 2026 16:20
@rubensworks rubensworks merged commit c22213d into master-1.21-lts Feb 28, 2026
5 checks passed
@coveralls
Copy link

Coverage Status

coverage: 45.677% (+0.1%) from 45.571%
when pulling 793c859 on copilot/fix-tutorial-progression-errors
into c394db2 on master-1.21-lts.

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.

Progression errors for manual tutorial

3 participants