1

I have created a custom fish that comes out of a custom loot table, and it took a while to get it to have a name. It turned out that there is a function called set_name and I could name the item. Now I want to add a lore to the item, however, I tried set_lore and it broke the loot table like before. (You Get Nothing From Fishing). I need to know what the function is to add a lore to the object.

Here is the Fish Item (Working Without Lore):

{
  "type": "minecraft:fishing",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:tropical_fish",
          "weight": 1000,
          "quality": -1,
          "functions": [
            {
              "function": "set_nbt",
              "tag": "{CustomModelData:3}"
            },
            {
              "function": "minecraft:set_name",
              "name": {
                "text": "Bluegill",
                "color": "white",
                "italic": "false"
              }
            }
          ]
        }
      ]
    }
  ]
}

Here is what I tried to add the lore with (Errors Out And No Fish For You):

{
  "type": "minecraft:fishing",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:tropical_fish",
          "weight": 1000,
          "quality": -1,
          "functions": [
            {
              "function": "set_nbt",
              "tag": "{CustomModelData:3}"
            },
            {
              "function": "minecraft:set_name",
              "name": {
                "text": "Bluegill",
                "color": "white",
                "italic": "false"
              }
            },
            {
              "function": "minecraft:set_lore",
              "lore": {
                "text": "Test",
                "color": "gray",
                "italic": "false"
              }
            }
          ]
        }
      ]
    }
  ]
}

Does anyone know the magic Minecraft json function to add a lore?

2
  • Does it work if you set name and lore via NBT? This is still a valid question, but that could be a workaround for you for now. Jul 27, 2019 at 5:18
  • I think loading a data pack with an invalid loot table prints a proper error message to the log, can you please check if there is something like that? Jul 27, 2019 at 5:21

1 Answer 1

1

The wiki (archive) explains lore in set_lore as "List of JSON text components", so you probably need square brackets around it:

              "function": "minecraft:set_lore",
              "lore": [
                {
                  "text": "Test",
                  "color": "gray",
                  "italic": "false"
                }
              ]

Disclaimer: I didn't test this, I just applied the usual Minecraft commands logic to the wiki's explanation.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .