Talk:Give Player an Item using player.giveItem()/@comment-178.236.128.184-20150301113024/@comment-26100675-20150301213826

The following functions will help you out:  ScriptEventDamaged.getSource ScriptLivingBase.getType and  EntityType

I've also created a basic example here: Determine_Damage_Source