DamageSource
Link to damagesource
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 Copyimport crafttweaker.api.world.damage.DamageSource;
Static Methods
Link to static-methods
Name: create
Return Type: DamageSource
ZenScript CopyDamageSource.create(type as DamageType, damageSourcePosition as Vec3) as DamageSource
Parameter | Type |
---|---|
Parameter type | Type DamageType |
Parameter damageSourcePosition | Type Vec3 |
Name: create
Return Type: DamageSource
ZenScript CopyDamageSource.create(type as DamageType, directEntity as Entity, causingEntity as Entity) as DamageSource
Parameter | Type | Optional |
---|---|---|
Parameter type | Type DamageType | Optional false |
Parameter directEntity | Type Entity | Optional true |
Parameter causingEntity | Type Entity | Optional true |
Methods
Link to methods
Name: getLocalizedDeathMessage
Return Type: Component
ZenScript CopyDamageSource.getLocalizedDeathMessage(entity as LivingEntity) as Component
Parameter | Type |
---|---|
Parameter entity | Type LivingEntity |
Name: isIn
Return Type: boolean
ZenScript CopyDamageSource.isIn(tag as KnownTag<DamageType>) as boolean
Parameter | Type |
---|---|
Parameter tag | Type KnownTag<DamageType> |
Properties
Link to properties
Name | Type | Has Getter | Has 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 |