DamageSource
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
import crafttweaker.api.world.damage.DamageSource;
Members
static create(type as DamageType, directEntity as Entity = null, causingEntity as Entity = null) as DamageSource
// DamageSource.create(type as DamageType, directEntity as Entity = null, causingEntity as Entity = null) as DamageSource;DamageSource.create(myDamageType, myEntity, myEntity);
Parameters:
type: DamageType
Type: DamageType
Return Type:
DamageSource
static create(type as DamageType, damageSourcePosition as Vec3) as DamageSource
DamageSource.create(myDamageType, myVec3);
Parameters:
type: DamageType
Type: DamageType
Return Type:
DamageSource
Getter
// DamageSource.foodExhaustion as floatmyDamageSource.foodExhaustion
Return Type:
float
getLocalizedDeathMessage(entity as LivingEntity) as Component
myDamageSource.getLocalizedDeathMessage(myLivingEntity);
Parameters:
entity: LivingEntity
Type: LivingEntity
Return Type:
Component
Getter
// DamageSource.indirect as boolmyDamageSource.indirect
Return Type:
bool
Getter
// DamageSource.isCreativePlayer as boolmyDamageSource.isCreativePlayer
Return Type:
bool
isIn(tag as KnownTag<DamageType>) as bool
myDamageSource.isIn(myKnownTag);
Parameters:
tag: KnownTag<DamageType>
Type: KnownTag<DamageType>
Return Type:
bool
Getter
// DamageSource.msgId as stringmyDamageSource.msgId
Return Type:
string
Getter
// DamageSource.scalesWithDifficulty as boolmyDamageSource.scalesWithDifficulty
Return Type:
bool
Getter
// DamageSource.type as DamageTypemyDamageSource.type
Return Type:
DamageType