0

Ok, I've created a custom loot table for fishing that adds a fish with a Custom-Model-Data tag. However, for some reason, I can't seem to be able to combine the custom name.

Here is the data of the item I want in the loot table:

/give @p minecraft:tropical_fish{display:{Name:"{\"text\":\"Bluegill\",\"italic\":false}"},CustomModelData:3} 1

Here is the current working loot table without the name:

{
  "type": "minecraft:fishing",
  "pools": [
    {
      "rolls": 1.0,
      "entries": [
        {
          "type": "minecraft:item",
          "weight": 10,
          "name": "minecraft:cod"
        },
        {
          "type": "minecraft:item",
          "weight": 10,
          "name": "minecraft:salmon"
        },
        {
          "type": "minecraft:item",
          "weight": 3,
          "name": "minecraft:pufferfish"
        },
        {
          "type": "minecraft:item",
          "weight": 10,
          "name": "minecraft:tropical_fish"
        },
        {
          "type": "minecraft:item",
          "name": "minecraft:tropical_fish",
          "weight": 85,
          "functions": [
            {
              "function": "set_nbt",
              "tag": "{CustomModelData:3}"
            }
          ]
        }
      ]
    }
  ]
}

It's the last one, the tropical fish. Thanks!


Ok, I found what I need but I still need to combine them. The custom name is a function

    {
    "function": "minecraft:set_name",
    "name": {
        "text": "Test",
        "color": "red
    }
}

I need to add this to:

"functions": [
            {
              "function": "set_nbt",
              "tag": "{CustomModelData:3}"
            }
          ]

I'm not the best at JSON so could someone help me add to this function set?

  • Sooo… What is your actual problem? Does it not work right when you add the other tag? If yes, in what way? – Fabian Röling Jul 25 at 2:17
  • I have tried adding in the name with the nbt tag and it breaks the whole thing, so I was wondering if anyone could help format it correctly. – Sjam Jul 25 at 2:32
  • 1
    How does it break it? What actually happens? Do you not get any loot anymore? Does the data pack not even appear in the list? Does your house explode? – Fabian Röling Jul 25 at 2:42
  • I believe since I did not structure the JSON correctly and that it just corrupts the loot table for fishing, so every time I go fishing and I reel in I get nothing. No fish, so all i need is it to be properly formatted so I can reel in a fish with the name Bluegill and have the nbt cutom model data. – Sjam Jul 25 at 13:14
1

Got It!

{
  "type": "minecraft:fishing",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "weight": 10,
          "name": "minecraft:cod"
        },
        {
          "type": "minecraft:item",
          "weight": 10,
          "name": "minecraft:salmon"
        },
        {
          "type": "minecraft:item",
          "weight": 3,
          "name": "minecraft:pufferfish"
        },
        {
          "type": "minecraft:item",
          "weight": 10,
          "name": "minecraft:tropical_fish"
        },
        {
          "type": "minecraft:item",
          "name": "minecraft:tropical_fish",
          "weight": 85,
          "functions": [
            {
              "function": "set_nbt",
              "tag": "{CustomModelData:3}"
            },
            {
              "function": "minecraft:set_name",
              "name": {
                "text": "Bluegill",
                "color": "blue"
              }
            }
          ]
        }
      ]
    }
  ]
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.