mojira.dev
MC-270918

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

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"
  }
]

Attachments

Comments 2

Is this a problem introduced in 1.20.5-rc1, or did this also happen in snapshots before?

First version with this issue seems to be 24w10a

manyrandomthings

etanaratsastaja

Confirmed

Platform

Low

Loot tables

24w10a, 1.20.5 Release Candidate 1

25w31a

Retrieved