An IDamageSource object is the source of damage to an entity.

Importare la Classe

Link to importare-la-classe

It might be required to import the class to avoid errors.
import crafttweaker.damage.IDamageSource;

Zengetters and ZenMethods without parameters

Link to zengetters-and-zenmethods-without-parameters

ZenGetterZenMethodReturn Type
ZenGetter
harmInCreative
ZenMethod
canHarmInCreative();
Return Type
bool
ZenGetter
damageType
ZenMethod
getDamageType();
Return Type
string
ZenGetter
hungerDamage
ZenMethod
getHungerDamage();
Return Type
float
ZenGetter
immediateSource
ZenMethod
getImmediateSource();
Return Type
IEntity
ZenGetter
trueSource
ZenMethod
getTrueSource();
Return Type
IEntity
ZenGetter
creativePlayer
ZenMethod
isCreativePlayer();
Return Type
bool
ZenGetter
damageLocation
ZenMethod
getDamageLocation();
Return Type
IVector3d
ZenGetter
damageAbsolute
ZenMethod
isDamageAbsolute();
Return Type
bool
ZenGetter
damageUnblockable
ZenMethod
isDamageUnblockable();
Return Type
bool
ZenGetter
difficultyScaled
ZenMethod
isDifficultyScaled();
Return Type
bool
ZenGetter
explosion
ZenMethod
isExplosion();
Return Type
bool
ZenGetter
fireDamage
ZenMethod
isFireDamage();
Return Type
bool
ZenGetter
magicDamage
ZenMethod
isMagicDamage();
Return Type
bool
ZenGetter
projectile
ZenMethod
isProjectile();
Return Type
bool
ZenGetter
ZenMethod
setDamageAllowedInCreativeMode();
Return Type
IDamageSource
ZenGetter
ZenMethod
setDamageBypassesArmor();
Return Type
IDamageSource
ZenGetter
ZenMethod
setDamageIsAbsolute();
Return Type
IDamageSource
ZenGetter
ZenMethod
setDifficultyScaled();
Return Type
IDamageSource
ZenGetter
ZenMethod
setExplosion();
Return Type
IDamageSource
ZenGetter
ZenMethod
setFireDamage();
Return Type
IDamageSource
ZenGetter
ZenMethod
setMagicDamage();
Return Type
IDamageSource
ZenGetter
ZenMethod
setProjectile();
Return Type
IDamageSource

ZenMethod with Parameters

Link to zenmethod-with-parameters

  • getDeathMessage(IEntity entity); → Returns a string containing the death message for the entity if it dies by this damageSource

Getting an IDamageSource Object

Link to getting-an-idamagesource-object

You can either use these methods or the Damage Source Bracket Handler.

ZenScript
Copy
crafttweaker.damage.IDamageSource.createMobDamage(IEntityLivingBase mob)
crafttweaker.damage.IDamageSource.createIndirectDamage(IEntity trueSource, IEntityLivingBase immediateSource)
crafttweaker.damage.IDamageSource.createPlayerDamage(IPlayer player)
crafttweaker.damage.IDamageSource.createThrownDamage(IEntity trueSource, @Optional IEntity immediateSource)
crafttweaker.damage.IDamageSource.createIndirectMagicDamage(IEntity trueSource, @Optional IEntity immediateSource)
crafttweaker.damage.IDamageSource.createThornsDamage(IEntity source)
crafttweaker.damage.IDamageSource.createExplosionDamage(@Optional IEntityLivingBase trueSource)
crafttweaker.damage.IDamageSource.createOfType(String type)
crafttweaker.damage.IDamageSource.createEntityDamage(String type, IEntity source)
crafttweaker.damage.IDamageSource.createIndirectDamage(String type, IEntity trueSource, @Optional IEntity immediateSource)

//Preregistered Damage Types
crafttweaker.damage.IDamageSource.IN_FIRE()
crafttweaker.damage.IDamageSource.LIGHTNING_BOLT()
crafttweaker.damage.IDamageSource.ON_FIRE()
crafttweaker.damage.IDamageSource.LAVA()
crafttweaker.damage.IDamageSource.HOT_FLOOR()
crafttweaker.damage.IDamageSource.IN_WALL()
crafttweaker.damage.IDamageSource.CRAMMING()
crafttweaker.damage.IDamageSource.DROWN()
crafttweaker.damage.IDamageSource.STARVE()
crafttweaker.damage.IDamageSource.CACTUS()
crafttweaker.damage.IDamageSource.FALL()
crafttweaker.damage.IDamageSource.FLY_INTO_WALL()
crafttweaker.damage.IDamageSource.OUT_OF_WORLD()
crafttweaker.damage.IDamageSource.GENERIC()
crafttweaker.damage.IDamageSource.MAGIC()
crafttweaker.damage.IDamageSource.WITHER()
crafttweaker.damage.IDamageSource.ANVIL()
crafttweaker.damage.IDamageSource.FALLING_BLOCK()
crafttweaker.damage.IDamageSource.DRAGON_BREATH()
crafttweaker.damage.IDamageSource.FIREWORKS()