mojira.dev
MC-277027

Shapeless recipes accept anything if one of their ingredients is an empty tag

Shapeless recipes accept anything in empty tag ingredients. (As long as there is something).

For example, the following recipe:

{
  "type": "minecraft:crafting_shapeless",
  "category": "building",
  "ingredients": [
    "minecraft:diorite",
    "#c:cobblestones/doesntexist"
  ],
  "result": {
    "count": 2,
    "id": "minecraft:diamond"
  }
}

with the following tag file for the tag:

{
  "values": []
}

causes a warning to be printed in the chat:

Recipe minecraft:test_recipe can't be placed due to empty ingredients and will be ignored

However, the recipe will accept any two items and give two diamonds as a result.

How to reproduce:

The attached data pack contains a shapeless recipe that accepts stone and an empty tag and returns smooth stone, and an empty item tag.

  1. Add the attached data pack to a world.

  2. Place any two items in a crafting grid.
    → ❌ Smooth stone appears in the crafting output.

Expected result:

The recipe wouldn't validate due to the empty tag in the ingredients list.

Observed result:

A message is printed in the log saying that the recipe didn't validate, but putting any two items in a crafting grid outputs smooth stone.

Possible cause:

Looks like the PlacementInfo for the recipe is `PlacementInfo.NOT_PLACEABLE`, but that doesn't prevent the shapeless recipe from matching as long as the item count is equal to the ingredient count.

Attachments

Comments 2

We do not have enough information to reproduce this issue.

Please include the following information to help us understand your problem:

Steps to Reproduce:
1. (Explain what needs to be done for the issue to happen)
2.
3.

Observed Results:
(Briefly describe what happens)

Expected Results:
(Briefly describe what should happen)

Please also attach any needed commands, add-ons/behavior packs, data packs, resource packs, screenshots, videos, or worlds needed to help reproduce this issue.

Refer to the Bug Tracker Guidelines for more information about how to write helpful bug reports. Bug reports with insufficient information may be closed as Incomplete.

This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

I've attached a datapack for testing. It contains two files:

  • A shapeless recipe that accepts stone and an empty tag and returns smooth stone

  • An empty item tag

Expected Result: The recipe doesn't validate due to the empty tag in the ingredients list.

Observed Result: The recipe says it doesn't validate in the logger, but putting any two items in the crafting table will output smooth stone.

Technici4n

boq

Confirmed

Platform

Low

(Unassigned)

24w39a

1.21.2 Pre-Release 1

Retrieved