net.minecraft.util
Class DamageSource

java.lang.Object
  extended by net.minecraft.util.DamageSource
Direct Known Subclasses:
EntityDamageSource

public class DamageSource
extends Object


Field Summary
static DamageSource anvil
           
static DamageSource cactus
           
 String damageType
           
static DamageSource drown
           
static DamageSource explosion
           
static DamageSource explosion2
           
static DamageSource fall
           
static DamageSource fallingBlock
           
static DamageSource generic
           
static DamageSource inFire
           
static DamageSource inWall
           
static DamageSource lava
           
static DamageSource magic
           
static DamageSource onFire
           
static DamageSource outOfWorld
           
static DamageSource starve
           
static DamageSource wither
           
 
Method Summary
 boolean canHarmInCreative()
           
static DamageSource causeArrowDamage(EntityArrow par0EntityArrow, Entity par1Entity)
          returns EntityDamageSourceIndirect of an arrow
static DamageSource causeFireballDamage(EntityFireball par0EntityFireball, Entity par1Entity)
          returns EntityDamageSourceIndirect of a fireball
static DamageSource causeIndirectMagicDamage(Entity par0Entity, Entity par1Entity)
           
static DamageSource causeMobDamage(EntityLiving par0EntityLiving)
           
static DamageSource causePlayerDamage(EntityPlayer par0EntityPlayer)
          returns an EntityDamageSource of type player
static DamageSource causeThrownDamage(Entity par0Entity, Entity par1Entity)
           
static DamageSource func_92036_a(Entity par0Entity)
           
 String getDamageType()
          Return the name of damage type.
 String getDeathMessage(EntityPlayer par1EntityPlayer)
          Returns the message to be displayed on player death.
 Entity getEntity()
           
 float getHungerDamage()
          How much satiate(food) is consumed by this DamageSource
 Entity getSourceOfDamage()
           
 boolean isDifficultyScaled()
          Return whether this damage source will have its damage amount scaled based on the current difficulty.
 boolean isFireDamage()
          Returns true if the damage is fire based.
 boolean isMagicDamage()
          Returns true if the damage is magic based.
 boolean isProjectile()
          Returns true if the damage is projectile based.
 boolean isUnblockable()
           
 DamageSource setDifficultyScaled()
          Set whether this damage source will have its damage amount scaled based on the current difficulty.
 DamageSource setMagicDamage()
          Define the damage type as magic based.
 DamageSource setProjectile()
          Define the damage type as projectile based.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inFire

public static DamageSource inFire

onFire

public static DamageSource onFire

lava

public static DamageSource lava

inWall

public static DamageSource inWall

drown

public static DamageSource drown

starve

public static DamageSource starve

cactus

public static DamageSource cactus

fall

public static DamageSource fall

outOfWorld

public static DamageSource outOfWorld

generic

public static DamageSource generic

explosion

public static DamageSource explosion

explosion2

public static DamageSource explosion2

magic

public static DamageSource magic

wither

public static DamageSource wither

anvil

public static DamageSource anvil

fallingBlock

public static DamageSource fallingBlock

damageType

public String damageType
Method Detail

causeMobDamage

public static DamageSource causeMobDamage(EntityLiving par0EntityLiving)

causePlayerDamage

public static DamageSource causePlayerDamage(EntityPlayer par0EntityPlayer)
returns an EntityDamageSource of type player


causeArrowDamage

public static DamageSource causeArrowDamage(EntityArrow par0EntityArrow,
                                            Entity par1Entity)
returns EntityDamageSourceIndirect of an arrow


causeFireballDamage

public static DamageSource causeFireballDamage(EntityFireball par0EntityFireball,
                                               Entity par1Entity)
returns EntityDamageSourceIndirect of a fireball


causeThrownDamage

public static DamageSource causeThrownDamage(Entity par0Entity,
                                             Entity par1Entity)

causeIndirectMagicDamage

public static DamageSource causeIndirectMagicDamage(Entity par0Entity,
                                                    Entity par1Entity)

func_92036_a

public static DamageSource func_92036_a(Entity par0Entity)

isProjectile

public boolean isProjectile()
Returns true if the damage is projectile based.


setProjectile

public DamageSource setProjectile()
Define the damage type as projectile based.


isUnblockable

public boolean isUnblockable()

getHungerDamage

public float getHungerDamage()
How much satiate(food) is consumed by this DamageSource


canHarmInCreative

public boolean canHarmInCreative()

getSourceOfDamage

public Entity getSourceOfDamage()

getEntity

public Entity getEntity()

getDeathMessage

public String getDeathMessage(EntityPlayer par1EntityPlayer)
Returns the message to be displayed on player death.


isFireDamage

public boolean isFireDamage()
Returns true if the damage is fire based.


getDamageType

public String getDamageType()
Return the name of damage type.


setDifficultyScaled

public DamageSource setDifficultyScaled()
Set whether this damage source will have its damage amount scaled based on the current difficulty.


isDifficultyScaled

public boolean isDifficultyScaled()
Return whether this damage source will have its damage amount scaled based on the current difficulty.


isMagicDamage

public boolean isMagicDamage()
Returns true if the damage is magic based.


setMagicDamage

public DamageSource setMagicDamage()
Define the damage type as magic based.