misode / misode.github.io

Data Pack Generators and Tools for Minecraft 1.15, 1.16, 1.17, 1.18, 1.19, 1.20, 1.21
https://misode.github.io/
MIT License
491 stars 68 forks source link

The `custom_name` and `item_name` components don't support translation values, keybinds #538

Closed Owehttamy closed 3 weeks ago

Owehttamy commented 4 weeks ago

Generators that allow you to specify item components only demand a string value when using the custom_name and item_name components; there isn't any ability to clarify whether or not the value is a string, translation value, or keybind.

Example:

Head to the 1.21 generator

  "type": "minecraft:crafting_shapeless",
  "category": "misc",
  "group": "lgbt_banners",
  "ingredients": [
    {
      "tag": "minecraft:banners"
    },
    {
      "item": "minecraft:red_mushroom"
    }
  ],
  "result": {
    "id": "minecraft:white_banner",
    "count": 1,
    "components": {
      "minecraft:banner_patterns": [
        {
          "pattern": "lgbt:aromantic",
          "color": "white"
        }
      ],
      "minecraft:rarity": "uncommon",
      "minecraft:item_name": "lgbt.flag.aromantic.white"
    }
  }
}
misode commented 3 weeks ago

Those components expect a stringified text component, so you would need:

"minecraft:item_name": "{\"translate\":\"lgbt.flag.aromantic.white\"}"