Mojira Archive
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.

Fixed

Technici4n

[Mojang] Bartosz Bok

2024-09-29, 02:45 PM

2024-10-07, 06:16 AM

2024-10-07, 06:16 AM

5

4

Confirmed

Low

Platform

(Unassigned)

24w39a

1.21.2 Pre-Release 1