misode.github.io icon indicating copy to clipboard operation
misode.github.io copied to clipboard

The function "Set enchantments" doesn't accurately display an example for books

Open Tholleman opened this issue 1 year ago • 0 comments

Take the following loot table example:

{
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:book",
          "functions": [
            {
              "function": "minecraft:set_enchantments",
              "enchantments": {
                "minecraft:lure": 3
              }
            }
          ]
        }
      ]
    }
  ]
}

In Minecraft, this will generate an enchanted book with Lure III as a stored enchantment. The example item in the generator creates a glowing book. It probably gives the book an nbt with {Enchantments:[{id:"minecraft:lure",lvl:3}]} instead of {StoredEnchantments:[{id:"minecraft:lure",lvl:3}]}. That would be correct for other items but books are a special case.

Tholleman avatar Feb 25 '24 09:02 Tholleman