Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-270918

Loot tables for mob heads are missing copy_components loot function for custom_name

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 24w10a, 1.20.5 Release Candidate 1
    • None
    • Confirmed
    • Loot tables
    • Low
    • Platform

      When breaking any non-player mob head, the custom_name tag isn't copied to the item's custom_name component, unlike with player heads where the data is properly copied

      This is due to the player_head loot table having the function "minecraft:copy_components" include "minecraft:custom_name", but that is missing from all the other head types

      1. Use an anvil to rename any non-player mob head
      2. Place the head on the ground
      3. Run "/data get block <x> <y> <z>" on the mob head block to observe that it still has the item's custom_name
      4. Break the mob head, the item will not copy the name from the block entity
      5. Repeat the steps above but with a player head to see that it does copy the name for player heads

      Attached is a datapack that can fix this issue by adding this missing loot function to each of the mob head's loot tables:

      "functions": [
        {
          "function": "minecraft:copy_components",
          "include": [
            "minecraft:custom_name"
          ],
          "source": "block_entity"
        }
      ]
      

            Unassigned Unassigned
            manyrandomthings manyrandomthings
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              CHK: