Affects Version/s: 1.15.2
Fix Version/s: None
Some mobs, will drop certain items when killed by a player or tamed wolf.
an angry Zombie pigmen died due to natural causes (command, fall damage, etc.) counts toward player kill of the player they're targetting, thus drop gold ingot, gold sword, and exp.
However, there's a bit of consistency: When the zombie pigman was angry toward a non-player mob (iron golem, snow golem, etc.), their death will still drop exp and gold sword as if it was killed by a player, but never the pigman will drop gold ingot.
You can easily test this in creative mode.
Spawn a pack of a few hundreds zombie pigman, then spawn a snow golem. After they got angry, proceed to kill them with fall damage or command. They drop exp, sword but no ingot. Note that the same result apply to when the snow golem dies, and pigmans start to target player.
Spawn another pack, but then directly punch them, then kill them with command, you'll see gold ingot popping out.