MobEffectUtil

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.entity.effect.MobEffectUtil;

Members

static formatDuration(instance as MobEffectInstance, durationFactor as float, ticksPerSecond as float) as Component
Formats the duration of a MobEffectInstance.

Returns: The formatted duration.

script.zs
// MobEffectUtil.formatDuration(instance as MobEffectInstance, durationFactor as float, ticksPerSecond as float) as Component;
MobEffectUtil.formatDuration(myMobEffectInstance, myFloat, myFloat);

Parameters:

durationFactor Type: float - The factor to multiply the duration by.
ticksPerSecond Type: float - The number of ticks per second.

Return Type: Component

static getDigSpeedAmplification(entity as LivingEntity) as int
Gets the dig speed amplification of the LivingEntity.

Returns: The dig speed amplification of the LivingEntity.

script.zs
// MobEffectUtil.getDigSpeedAmplification(entity as LivingEntity) as int;
MobEffectUtil.getDigSpeedAmplification(myLivingEntity);

Parameters:

entity Type: LivingEntity - The LivingEntity to get the dig speed amplification of.

Return Type: int

static hasDigSpeed(entity as LivingEntity) as bool
Checks if the LivingEntity has dig speed.

Returns: True if the LivingEntity has dig speed, false otherwise.

script.zs
// MobEffectUtil.hasDigSpeed(entity as LivingEntity) as bool;
MobEffectUtil.hasDigSpeed(myLivingEntity);

Parameters:

entity Type: LivingEntity - The LivingEntity to check.

Return Type: bool

static hasWaterBreathing(entity as LivingEntity) as bool
Checks if the LivingEntity has water breathing.

Returns: True if the LivingEntity has water breathing, false otherwise.

script.zs
// MobEffectUtil.hasWaterBreathing(entity as LivingEntity) as bool;
MobEffectUtil.hasWaterBreathing(myLivingEntity);

Parameters:

entity Type: LivingEntity - The LivingEntity to check.

Return Type: bool