Mojira Archive
MC-76740

Mobs using melee weapons don't have a renamed weapon show up in a player death message

If a mob wielding a renamed weapon kills you, it's renamed weapon doesn't show in the death message.

What I expected to happen was...:
If any mob wielding a melee weapon (i.e. not a bow) that is renamed is spawned, and if you let the mob kill you, it should say: <player name> was slain by <name of mob> using <name of weapon>

What actually happened was...:
The death message was <player name> was slain by <name of mob>

Steps to Reproduce:
1. Enter this command into a command block and activate it:

/summon Zombie ~ ~1 ~ {CustomName:"Zombie test dummy",HandItems:[{id:"minecraft:diamond_sword",Count:1b,tag:{display:{Name:"This Sword",Lore:["This is a test!"]}}},{}]}

2. Switch to survival or adventure and let the Zombie kill you.
3. The death message says: <player name> was slain by Zombie test dummy, as seen in Screenshot 1. But it should actually say <player name> was slain by Zombie test dummy using [This Sword]

An additional detail here is that if a Skeleton kills you with a renamed bow the death message works just fine, as seen in Screenshot 2. Test it with this command:

/summon Skeleton ~ ~1 ~ {CustomName:"Renamed Skeleton",HandItems:[{id:"minecraft:bow",Count:1b,tag:{display:{Name:"Renamed Bow",Lore:["This is also a test!"]}}},{}]}

Code analysis by Marcono1234 can be found in this comment.