I was making a map for me and my friends to play and one of the features in it was you were given a golden hoe called the Staff of the Sun and when you hit a zombie it takes damage and "burns them to ashes" but I found that when you hit a mob it takes no damage. I have not renamed the item yet either. Farming with them still works though.
I believe it's because it's not a melee weapon. It's like breaking blocks with a bow (or hoe) not using durability.