DamageType

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.

script.zs
import crafttweaker.api.world.damage.DamageType;

Constructors

new(msgId as string, scaling as DamageScaling, exhaustion as float, effects as DamageEffects, deathMessageType as DeathMessageType)
Creates a new DamageType using the provided values
script.zs
// new DamageType(msgId as string, scaling as DamageScaling, exhaustion as float, effects as DamageEffects, deathMessageType as DeathMessageType);
new DamageType(myString, myDamageScaling, myFloat, myDamageEffects, myDeathMessageType);

Parameters:

msgId Type: string - The unlocalized name of this type
scaling Type: DamageScaling - The damage scaling used by this type
exhaustion Type: float - How much exhaustion does this type cause
effects Type: DamageEffects - The effect of this type
deathMessageType Type: DeathMessageType - The type of death message to send
new(msgId as string, scaling as DamageScaling, exhaustion as float)
Creates a new DamageType using the provided values
script.zs
// new DamageType(msgId as string, scaling as DamageScaling, exhaustion as float);
new DamageType(myString, myDamageScaling, myFloat);

Parameters:

msgId Type: string - The unlocalized name of this type
scaling Type: DamageScaling - The damage scaling used by this type
exhaustion Type: float - How much exhaustion does this type cause
new(msgId as string, scaling as DamageScaling, exhaustion as float, effects as DamageEffects)
Creates a new DamageType using the provided values
script.zs
// new DamageType(msgId as string, scaling as DamageScaling, exhaustion as float, effects as DamageEffects);
new DamageType(myString, myDamageScaling, myFloat, myDamageEffects);

Parameters:

msgId Type: string - The unlocalized name of this type
scaling Type: DamageScaling - The damage scaling used by this type
exhaustion Type: float - How much exhaustion does this type cause
effects Type: DamageEffects - The effect of this type
new(msgId as string, exhaustion as float, effects as DamageEffects)
Creates a new DamageType using the provided values
script.zs
// new DamageType(msgId as string, exhaustion as float, effects as DamageEffects);
new DamageType(myString, myFloat, myDamageEffects);

Parameters:

msgId Type: string - The unlocalized name of this type
exhaustion Type: float - How much exhaustion does this type cause
effects Type: DamageEffects - The effect of this type
new(msgId as string, exhaustion as float)
Creates a new DamageType using the provided values
script.zs
// new DamageType(msgId as string, exhaustion as float);
new DamageType(myString, myFloat);

Parameters:

msgId Type: string - The unlocalized name of this type
exhaustion Type: float - How much exhaustion does this type cause

Members

Getter
script.zs
// DamageType.deathMessageType as DeathMessageType
myDamageType.deathMessageType

Return Type: DeathMessageType

Getter
script.zs
// DamageType.effects as DamageEffects
myDamageType.effects

Return Type: DamageEffects

Getter
script.zs
// DamageType.exhaustion as float
myDamageType.exhaustion

Return Type: float

Getter
script.zs
// DamageType.msgId as string
myDamageType.msgId

Return Type: string

Getter
script.zs
// DamageType.scaling as DamageScaling
myDamageType.scaling

Return Type: DamageScaling