public class DamageSource
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static DamageSource |
anvil |
static DamageSource |
cactus |
private boolean |
damageIsAbsolute
Whether or not the damage ignores modification by potion effects or enchantments.
|
java.lang.String |
damageType |
private boolean |
difficultyScaled
Whether this damage source will have its damage amount scaled based on the current difficulty.
|
static DamageSource |
drown |
private boolean |
explosion |
static DamageSource |
fall |
static DamageSource |
fallingBlock |
private boolean |
fireDamage
This kind of damage is based on fire or not.
|
static DamageSource |
generic |
private float |
hungerDamage |
static DamageSource |
inFire |
static DamageSource |
inWall |
private boolean |
isDamageAllowedInCreativeMode |
private boolean |
isUnblockable
This kind of damage can be blocked or not.
|
static DamageSource |
lava |
static DamageSource |
lightningBolt |
static DamageSource |
magic |
private boolean |
magicDamage
Whether the damage is magic based.
|
static DamageSource |
onFire |
static DamageSource |
outOfWorld |
private boolean |
projectile
This kind of damage is based on a projectile or not.
|
static DamageSource |
starve |
static DamageSource |
wither |
Modifier | Constructor and Description |
---|---|
protected |
DamageSource(java.lang.String damageTypeIn) |
Modifier and Type | Method and Description |
---|---|
boolean |
canHarmInCreative() |
static DamageSource |
causeArrowDamage(EntityArrow arrow,
Entity p_76353_1_)
returns EntityDamageSourceIndirect of an arrow
|
static DamageSource |
causeFireballDamage(EntityFireball fireball,
Entity p_76362_1_)
returns EntityDamageSourceIndirect of a fireball
|
static DamageSource |
causeIndirectMagicDamage(Entity p_76354_0_,
Entity p_76354_1_) |
static DamageSource |
causeMobDamage(EntityLivingBase mob) |
static DamageSource |
causePlayerDamage(EntityPlayer player)
returns an EntityDamageSource of type player
|
static DamageSource |
causeThornsDamage(Entity p_92087_0_)
Returns the EntityDamageSource of the Thorns enchantment
|
static DamageSource |
causeThrownDamage(Entity p_76356_0_,
Entity p_76356_1_) |
java.lang.String |
getDamageType()
Return the name of damage type.
|
IChatComponent |
getDeathMessage(EntityLivingBase p_151519_1_)
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() |
protected DamageSource |
setDamageAllowedInCreativeMode() |
protected DamageSource |
setDamageBypassesArmor() |
protected 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() |
static DamageSource |
setExplosionSource(Explosion explosionIn) |
protected 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 DamageSource inFire
public static DamageSource lightningBolt
public static DamageSource onFire
public static DamageSource lava
public static DamageSource inWall
public static DamageSource drown
public static DamageSource starve
public static DamageSource cactus
public static DamageSource fall
public static DamageSource outOfWorld
public static DamageSource generic
public static DamageSource magic
public static DamageSource wither
public static DamageSource anvil
public static DamageSource fallingBlock
private boolean isUnblockable
private boolean isDamageAllowedInCreativeMode
private boolean damageIsAbsolute
private float hungerDamage
private boolean fireDamage
private boolean projectile
private boolean difficultyScaled
private boolean magicDamage
private boolean explosion
public java.lang.String damageType
public static DamageSource causeMobDamage(EntityLivingBase mob)
public static DamageSource causePlayerDamage(EntityPlayer player)
public static DamageSource causeArrowDamage(EntityArrow arrow, Entity p_76353_1_)
public static DamageSource causeFireballDamage(EntityFireball fireball, Entity p_76362_1_)
public static DamageSource causeThrownDamage(Entity p_76356_0_, Entity p_76356_1_)
public static DamageSource causeIndirectMagicDamage(Entity p_76354_0_, Entity p_76354_1_)
public static DamageSource causeThornsDamage(Entity p_92087_0_)
public static DamageSource setExplosionSource(Explosion explosionIn)
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()
protected DamageSource setDamageBypassesArmor()
protected DamageSource setDamageAllowedInCreativeMode()
protected DamageSource setDamageIsAbsolute()
protected DamageSource setFireDamage()
public IChatComponent getDeathMessage(EntityLivingBase p_151519_1_)
public boolean isFireDamage()
public java.lang.String getDamageType()
public DamageSource setDifficultyScaled()
public boolean isDifficultyScaled()
public boolean isMagicDamage()
public DamageSource setMagicDamage()
public boolean isCreativePlayer()