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

Importing the class

Link to importing-the-class

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

ZenGetterZenMethod반환 타입
ZenGetter
harmInCreative
ZenMethod
canHarmInCreative();
반환 타입
bool
ZenGetter
damageType
ZenMethod
getDamageType();
반환 타입
string
ZenGetter
hungerDamage
ZenMethod
getHungerDamage();
반환 타입
float
ZenGetter
immediateSource
ZenMethod
getImmediateSource();
반환 타입
IEntity
ZenGetter
trueSource
ZenMethod
getTrueSource();
반환 타입
IEntity
ZenGetter
creativePlayer
ZenMethod
isCreativePlayer();
반환 타입
bool
ZenGetter
damageLocation
ZenMethod
getDamageLocation();
반환 타입
IVector3d
ZenGetter
damageAbsolute
ZenMethod
isDamageAbsolute();
반환 타입
bool
ZenGetter
damageUnblockable
ZenMethod
isDamageUnblockable();
반환 타입
bool
ZenGetter
difficultyScaled
ZenMethod
isDifficultyScaled();
반환 타입
bool
ZenGetter
explosion
ZenMethod
isExplosion();
반환 타입
bool
ZenGetter
fireDamage
ZenMethod
isFireDamage();
반환 타입
bool
ZenGetter
magicDamage
ZenMethod
isMagicDamage();
반환 타입
bool
ZenGetter
projectile
ZenMethod
isProjectile();
반환 타입
bool
ZenGetter
ZenMethod
setDamageAllowedInCreativeMode();
반환 타입
IDamageSource
ZenGetter
ZenMethod
setDamageBypassesArmor();
반환 타입
IDamageSource
ZenGetter
ZenMethod
setDamageIsAbsolute();
반환 타입
IDamageSource
ZenGetter
ZenMethod
setDifficultyScaled();
반환 타입
IDamageSource
ZenGetter
ZenMethod
setExplosion();
반환 타입
IDamageSource
ZenGetter
ZenMethod
setFireDamage();
반환 타입
IDamageSource
ZenGetter
ZenMethod
setMagicDamage();
반환 타입
IDamageSource
ZenGetter
ZenMethod
setProjectile();
반환 타입
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()