Skip to content

Book recipe entries with enchantment output don't list the enchantment levels #316

@DaFuqs

Description

@DaFuqs

Describe the bug
When displaying recipes in Modonomicon, I noticed that all recipes don't display the enchantments set in their recipe.json.

The recipe output is rendered as normal, using:

parentScreen.renderItemStack(..., recipe.getResultItem(world.registryAccess()));

What I know so far:

  • The recipe.getResultItem() works flawlessly. The result has it's enchantment component patch set and everything.
  • Recipe viewers, like EMI or REI display the enchantments just fine
  • The tooltips of other components are getting listed

It seems that something funky is going on in ItemEnchantments.addToTooltip(). But I have no idea what.

Expected behavior
The enchantments getting listed.

Screenshots
See the modonomicon entry vs. the one in EMI

Image Image

System (please complete the following information):

  • Modonomicon Version: 1.117.2
  • OS: Windows
  • Minecraft Version: 1.21.1
    • Additional Mods: Spectrum 1.9.7

Additional context

Here is a test recipe.json

{
  "type": "minecraft:crafting_shaped",
  "pattern": [
    "  R",
    " F ",
    "E  "
  ],
  "key": {
    "E": [
      {
        "item": "minecraft:stick"
      }
    ],
    "F": [
      {
        "item": "minecraft:copper_ingot"
      }
    ],
    "R": [
      {
        "tag": "minecraft:wool"
      }
    ]
  },
  "result": {
    "id": "minecraft:stick",
    "components": {
      "enchantments": {
        "minecraft:lure": 3
      }
    },
    "count": 1
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions