An entity source of profile on loot tables isn't available in some cases without the loot table being triggered by a player breaking a block or using a loot command as an entity.
For example, a block's loot table can be triggered due to terrain explosion damage with its source being a tnt entity, creeper, wither skull, etc. However, those type of source profiles aren't available.
Example:
A replaced block's loot table...
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:stone",
"functions": [
{
"function": "copy_nbt",
"source": "this",
"ops": [
{
"source": "{}",
"target": "EntitySourceProfile",
"op": "replace"
}
]
}
]
}
]
}
]
}
Triggered by a player either breaking this block or via a loot command as an entity will store the entire player's/entity's NBT data in the item being dropped under its NBT data in "EntitySourceProfile".
The item dropped via this loot table triggered with terrain explosion damage won't apply any data to the item as those cases don't seem to be supported.
Linked issues
duplicates 1
Comments 3
Just checked using tnt. Seems to work now! Still need to check all other cases but I guess its fixed.
Nice! I believe the fix was the fix for MC-153820, so I'll go ahead and resolve it into there. Just leave a comment if we should reopen
Is this still the case in the current snapshot?