Fabric API

Fabric API

106M Downloads

[Fabric API 0.46.0+1.18] `fabric:item_tags_populated` seems not working

Kotori316 opened this issue ยท 0 comments

commented

Hello.
The tag condition is not working now. This condition should allow the recipe to be loaded if the specific tag is present, but currently it always deny the loading of the recipe.

Test recipe file.

{
  "type": "minecraft:crafting_shaped",
  "pattern": [
    "pp",
    "pp"
  ],
  "key": {
    "p": {
      "tag": "c:bronze_ingots"
    }
  },
  "result": {
    "item": "minecraft:diamond"
  },
  "fabric:load_conditions": [
    {
      "condition": "fabric:item_tags_populated",
      "values": [
        "c:bronze_ingots"
      ]
    }
  ]
}

This recipe should work if bronze tag is provided by some mods like TechReborn, but with Fabric 0.46.0+1.18 and TechReborn the recipe doesn't appear in REI and I can't craft this recipe.


ResourceConditions.register(ITEM_TAGS_POPULATED, object -> ResourceConditionsImpl.tagsPopulatedMatch(object, ItemTags.getTagGroup()));

These codes call ItemTags.getTagGroup() and TagGroup<Item>#getTag(ResourceLocation), but the returned tag is null during the world is loaded first. The tag works fine after I execute /reload as TagGroup<Item>#getTag(ResourceLocation) returns non-null value.

  • Minecraft 1.18.1
  • Fabric API 0.46.0+1.18
  • Fabric Loader 0.12.12
  • fabric-resource-conditions-api-v1 1.0.0+1254045365

Thank you.