    001    package net.minecraft.src;
    002
    003    public class EntityDamageSource extends DamageSource
    004    {
    005        protected Entity damageSourceEntity;
    006
    007        public EntityDamageSource(String par1Str, Entity par2Entity)
    008        {
    009            super(par1Str);
    010            this.damageSourceEntity = par2Entity;
    011        }
    012
    013        public Entity getEntity()
    014        {
    015            return this.damageSourceEntity;
    016        }
    017
    018        /**
    019         * Returns the message to be displayed on player death.
    020         */
    021        public String getDeathMessage(EntityPlayer par1EntityPlayer)
    022        {
    023            return StatCollector.translateToLocalFormatted("death." + this.damageType, new Object[] {par1EntityPlayer.username, this.damageSourceEntity.getEntityName()});
    024        }
    025
    026        public boolean func_76350_n()
    027        {
    028            return this.damageSourceEntity != null && this.damageSourceEntity instanceof EntityLiving && !(this.damageSourceEntity instanceof EntityPlayer);
    029        }
    030    }