Package net.minecraft.util
Class DamageSource
- java.lang.Object
-
- net.minecraft.util.DamageSource
-
- Direct Known Subclasses:
EntityDamageSource
public class DamageSource extends java.lang.Object
+ This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. NOT FOR COMMERCIAL OR MALICIOUS USE (please read the 'LICENSE' file this repo's root directory for more info)
-
-
Field Summary
Fields Modifier and Type Field Description static DamageSource
anvil
static DamageSource
cactus
java.lang.String
damageType
static DamageSource
drown
static DamageSource
fall
static DamageSource
fallingBlock
static DamageSource
generic
static DamageSource
inFire
static DamageSource
inWall
static DamageSource
lava
static DamageSource
lightningBolt
static DamageSource
magic
static DamageSource
onFire
static DamageSource
outOfWorld
static DamageSource
starve
static DamageSource
wither
-
Constructor Summary
Constructors Modifier Constructor Description protected
DamageSource(java.lang.String damageTypeIn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canHarmInCreative()
static DamageSource
causeArrowDamage(EntityArrow arrow, Entity parEntity)
+ returns EntityDamageSourceIndirect of an arrowstatic DamageSource
causeFireballDamage(EntityFireball fireball, Entity parEntity)
+ returns EntityDamageSourceIndirect of a fireballstatic DamageSource
causeIndirectMagicDamage(Entity parEntity, Entity parEntity2)
static DamageSource
causeMobDamage(EntityLivingBase mob)
static DamageSource
causePlayerDamage(EntityPlayer player)
+ returns an EntityDamageSource of type playerstatic DamageSource
causeThornsDamage(Entity parEntity)
+ Returns the EntityDamageSource of the Thorns enchantmentstatic DamageSource
causeThrownDamage(Entity parEntity, Entity parEntity2)
java.lang.String
getDamageType()
+ Return the name of damage type.IChatComponent
getDeathMessage(EntityLivingBase parEntityLivingBase)
+ Gets the death message that is displayed when the player diesEntity
getEntity()
float
getHungerDamage()
+ How much satiate(food) is consumed by this DamageSourceEntity
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.
-
-
-
Field Detail
-
inFire
public static DamageSource inFire
-
lightningBolt
public static DamageSource lightningBolt
-
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
-
magic
public static DamageSource magic
-
wither
public static DamageSource wither
-
anvil
public static DamageSource anvil
-
fallingBlock
public static DamageSource fallingBlock
-
damageType
public java.lang.String damageType
-
-
Method Detail
-
causeMobDamage
public static DamageSource causeMobDamage(EntityLivingBase mob)
-
causePlayerDamage
public static DamageSource causePlayerDamage(EntityPlayer player)
+ returns an EntityDamageSource of type player
-
causeArrowDamage
public static DamageSource causeArrowDamage(EntityArrow arrow, Entity parEntity)
+ returns EntityDamageSourceIndirect of an arrow
-
causeFireballDamage
public static DamageSource causeFireballDamage(EntityFireball fireball, Entity parEntity)
+ returns EntityDamageSourceIndirect of a fireball
-
causeThrownDamage
public static DamageSource causeThrownDamage(Entity parEntity, Entity parEntity2)
-
causeIndirectMagicDamage
public static DamageSource causeIndirectMagicDamage(Entity parEntity, Entity parEntity2)
-
causeThornsDamage
public static DamageSource causeThornsDamage(Entity parEntity)
+ Returns the EntityDamageSource of the Thorns enchantment
-
setExplosionSource
public static DamageSource setExplosionSource(Explosion explosionIn)
-
isProjectile
public boolean isProjectile()
+ Returns true if the damage is projectile based.
-
setProjectile
public DamageSource setProjectile()
+ Define the damage type as projectile based.
-
isExplosion
public boolean isExplosion()
-
setExplosion
public DamageSource setExplosion()
-
isUnblockable
public boolean isUnblockable()
-
getHungerDamage
public float getHungerDamage()
+ How much satiate(food) is consumed by this DamageSource
-
canHarmInCreative
public boolean canHarmInCreative()
-
isDamageAbsolute
public boolean isDamageAbsolute()
+ Whether or not the damage ignores modification by potion effects or enchantments.
-
getSourceOfDamage
public Entity getSourceOfDamage()
-
getEntity
public Entity getEntity()
-
setDamageBypassesArmor
protected DamageSource setDamageBypassesArmor()
-
setDamageAllowedInCreativeMode
protected DamageSource setDamageAllowedInCreativeMode()
-
setDamageIsAbsolute
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.
-
setFireDamage
protected DamageSource setFireDamage()
+ Define the damage type as fire based.
-
getDeathMessage
public IChatComponent getDeathMessage(EntityLivingBase parEntityLivingBase)
+ Gets the death message that is displayed when the player dies
-
isFireDamage
public boolean isFireDamage()
+ Returns true if the damage is fire based.
-
getDamageType
public java.lang.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.
-
isCreativePlayer
public boolean isCreativePlayer()
-
-