DamageSource
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.
import crafttweaker.api.world.damage.DamageSource;
Static Methods
Return Type: DamageSource
DamageSource.create(type as DamageType, damageSourcePosition as Vec3) as DamageSource
Parameter | Type |
---|---|
Parameter type | Type DamageType |
Parameter damageSourcePosition | Type Vec3 |
Return Type: DamageSource
DamageSource.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
Return Type: Component
DamageSource.getLocalizedDeathMessage(entity as LivingEntity) as Component
Parameter | Type |
---|---|
Parameter entity | Type LivingEntity |
Return Type: boolean
DamageSource.isIn(tag as KnownTag<DamageType>) as boolean
Parameter | Type |
---|---|
Parameter tag | Type KnownTag<DamageType> |
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 |