public class DamageSource
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static DamageSource |
ANVIL |
static DamageSource |
CACTUS |
static DamageSource |
CRAMMING |
java.lang.String |
damageType |
static DamageSource |
DRAGON_BREATH |
static DamageSource |
DROWN |
static DamageSource |
FALL |
static DamageSource |
FALLING_BLOCK |
static DamageSource |
field_191552_t |
static DamageSource |
FLY_INTO_WALL |
static DamageSource |
GENERIC |
static DamageSource |
HOT_FLOOR |
static DamageSource |
IN_FIRE |
static DamageSource |
IN_WALL |
static DamageSource |
LAVA |
static DamageSource |
LIGHTNING_BOLT |
static DamageSource |
MAGIC |
static DamageSource |
ON_FIRE |
static DamageSource |
OUT_OF_WORLD |
static DamageSource |
STARVE |
static DamageSource |
WITHER |
Constructor and Description |
---|
DamageSource(java.lang.String damageTypeIn) |
Modifier and Type | Method and Description |
---|---|
boolean |
canHarmInCreative() |
static DamageSource |
causeArrowDamage(EntityArrow arrow,
Entity indirectEntityIn)
returns EntityDamageSourceIndirect of an arrow
|
static DamageSource |
causeExplosionDamage(EntityLivingBase entityLivingBaseIn) |
static DamageSource |
causeExplosionDamage(Explosion explosionIn) |
static DamageSource |
causeFireballDamage(EntityFireball fireball,
Entity indirectEntityIn)
returns EntityDamageSourceIndirect of a fireball
|
static DamageSource |
causeIndirectDamage(Entity source,
EntityLivingBase indirectEntityIn) |
static DamageSource |
causeIndirectMagicDamage(Entity source,
Entity indirectEntityIn) |
static DamageSource |
causeMobDamage(EntityLivingBase mob) |
static DamageSource |
causePlayerDamage(EntityPlayer player)
returns an EntityDamageSource of type player
|
static DamageSource |
causeThornsDamage(Entity source)
Returns the EntityDamageSource of the Thorns enchantment
|
static DamageSource |
causeThrownDamage(Entity source,
Entity indirectEntityIn) |
Vec3d |
getDamageLocation()
Gets the location from which the damage originates.
|
java.lang.String |
getDamageType()
Return the name of damage type.
|
ITextComponent |
getDeathMessage(EntityLivingBase entityLivingBaseIn)
Gets the death message that is displayed when the player dies
|
Entity |
getEntity() |
float |
getHungerDamage()
How much satiate(food) is consumed by this DamageSource
|
Entity |
getSourceOfDamage() |
boolean |
isCreativePlayer() |
boolean |
isDamageAbsolute()
Whether or not the damage ignores modification by potion effects or enchantments.
|
boolean |
isDifficultyScaled()
Return whether this damage source will have its damage amount scaled based on the current difficulty.
|
boolean |
isExplosion() |
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 |
setDamageAllowedInCreativeMode() |
DamageSource |
setDamageBypassesArmor() |
DamageSource |
setDamageIsAbsolute()
Sets a value indicating whether the damage is absolute (ignores modification by potion effects or enchantments),
and also clears out hunger damage.
|
DamageSource |
setDifficultyScaled()
Set whether this damage source will have its damage amount scaled based on the current difficulty.
|
DamageSource |
setExplosion() |
DamageSource |
setFireDamage()
Define the damage type as fire based.
|
DamageSource |
setMagicDamage()
Define the damage type as magic based.
|
DamageSource |
setProjectile()
Define the damage type as projectile based.
|
public static final DamageSource IN_FIRE
public static final DamageSource LIGHTNING_BOLT
public static final DamageSource ON_FIRE
public static final DamageSource LAVA
public static final DamageSource HOT_FLOOR
public static final DamageSource IN_WALL
public static final DamageSource CRAMMING
public static final DamageSource DROWN
public static final DamageSource STARVE
public static final DamageSource CACTUS
public static final DamageSource FALL
public static final DamageSource FLY_INTO_WALL
public static final DamageSource OUT_OF_WORLD
public static final DamageSource GENERIC
public static final DamageSource MAGIC
public static final DamageSource WITHER
public static final DamageSource ANVIL
public static final DamageSource FALLING_BLOCK
public static final DamageSource DRAGON_BREATH
public static final DamageSource field_191552_t
public java.lang.String damageType
public static DamageSource causeMobDamage(EntityLivingBase mob)
public static DamageSource causeIndirectDamage(Entity source, EntityLivingBase indirectEntityIn)
public static DamageSource causePlayerDamage(EntityPlayer player)
public static DamageSource causeArrowDamage(EntityArrow arrow, Entity indirectEntityIn)
public static DamageSource causeFireballDamage(EntityFireball fireball, Entity indirectEntityIn)
public static DamageSource causeThrownDamage(Entity source, Entity indirectEntityIn)
public static DamageSource causeIndirectMagicDamage(Entity source, Entity indirectEntityIn)
public static DamageSource causeThornsDamage(Entity source)
public static DamageSource causeExplosionDamage(Explosion explosionIn)
public static DamageSource causeExplosionDamage(EntityLivingBase entityLivingBaseIn)
public boolean isProjectile()
public DamageSource setProjectile()
public boolean isExplosion()
public DamageSource setExplosion()
public boolean isUnblockable()
public float getHungerDamage()
public boolean canHarmInCreative()
public boolean isDamageAbsolute()
public Entity getSourceOfDamage()
public Entity getEntity()
public DamageSource setDamageBypassesArmor()
public DamageSource setDamageAllowedInCreativeMode()
public DamageSource setDamageIsAbsolute()
public DamageSource setFireDamage()
public ITextComponent getDeathMessage(EntityLivingBase entityLivingBaseIn)
public boolean isFireDamage()
public java.lang.String getDamageType()
public DamageSource setDifficultyScaled()
public boolean isDifficultyScaled()
public boolean isMagicDamage()
public DamageSource setMagicDamage()
public boolean isCreativePlayer()
public Vec3d getDamageLocation()