Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataComponentIngredient behaves incorrectly in vanilla recipe book #1877

Open
AEAEAEAE4343 opened this issue Jan 19, 2025 · 0 comments
Open
Labels
triage Needs triaging and confirmation

Comments

@AEAEAEAE4343
Copy link

AEAEAEAE4343 commented Jan 19, 2025

Minecraft Version: 1.21.1 and 1.21.4
NeoForge Version: 21.1.93 and 21.4.65

Steps to Reproduce:
Create a basic recipe that uses a DataComponentngredient. This can be done with just a datapack:

{
  "type": "minecraft:crafting_shaped",
  "category": "misc",
  "key": {
    "B": {
      "type": "neoforge:components",
      "components": {
        "minecraft:stored_enchantments": {
          "levels": {
            "minecraft:sharpness": 4
          }
        }
      },
      "items": "minecraft:enchanted_book",
      "strict": false
    }
  },
  "pattern": [
    "   ",
    "   ",
    "  B"
  ],
  "result": {
    "count": 1,
    "id": "minecraft:dirt"
  }
}
(Note: for 1.21.4, "type" is now "neoforge:ingredient_type")

This one converts a Sharpness IV book into a dirt block. The recipe itself works if you put it in manually, but the game gets confused when there are multiple items with different components in the player's inventory.

The recipe book thinks the player has all the ingredients when, for example, the player has an Efficiency II book. When you click the recipe, it moves all the items (including the incorrect book) into the crafting display, and no crafting output is shown because the recipe is incorrect.

The issue occurs on 1.21.1 and 1.21.4, and presumably all versions in between.

@AEAEAEAE4343 AEAEAEAE4343 added the triage Needs triaging and confirmation label Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs triaging and confirmation
Projects
None yet
Development

No branches or pull requests

1 participant