Importing the class

Link to importing-the-class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

ZenScript
Copy
import crafttweaker.api.world.damage.DamageSource;

Name: create

Return Type: DamageSource

ZenScript
Copy
DamageSource.create(type as DamageType, damageSourcePosition as Vec3) as DamageSource
ParameterType
Parameter
type
Type
DamageType
Parameter
damageSourcePosition
Type
Vec3

Name: create

Return Type: DamageSource

ZenScript
Copy
DamageSource.create(type as DamageType, directEntity as Entity, causingEntity as Entity) as DamageSource
ParameterTypeOptional
Parameter
type
Type
DamageType
Optional
false
Parameter
directEntity
Type
Entity
Optional
true
Parameter
causingEntity
Type
Entity
Optional
true

Link to getLocalizedDeathMessage

Name: getLocalizedDeathMessage

Return Type: Component

ZenScript
Copy
DamageSource.getLocalizedDeathMessage(entity as LivingEntity) as Component
ParameterType
Parameter
entity
Type
LivingEntity

Name: isIn

Return Type: boolean

ZenScript
Copy
DamageSource.isIn(tag as KnownTag<DamageType>) as boolean
ParameterType
Parameter
tag
Type
KnownTag<DamageType>
NameTypeHas GetterHas Setter
Name
directEntity
Type
Entity?
Has Getter
true
Has Setter
false
Name
entity
Type
Entity?
Has Getter
true
Has Setter
false
Name
foodExhaustion
Type
float
Has Getter
true
Has Setter
false
Name
indirect
Type
boolean
Has Getter
true
Has Setter
false
Name
isCreativePlayer
Type
boolean
Has Getter
true
Has Setter
false
Name
msgId
Type
string
Has Getter
true
Has Setter
false
Name
scalesWithDifficulty
Type
boolean
Has Getter
true
Has Setter
false
Name
sourcePosition
Type
Vec3?
Has Getter
true
Has Setter
false
Name
sourcePositionRaw
Type
Vec3?
Has Getter
true
Has Setter
false
Name
type
Type
DamageType
Has Getter
true
Has Setter
false