MobEffect

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.MobEffect;

Implements

Undocumented Interfaces

FeatureElement,IMobEffectExtension

Members

addAttributeModifier(attribute as Attribute, id as ResourceLocation, value as double, operation as Operation) as MobEffect
Adds an attribute modifier to the effect.

Returns: The effect with the added modifier.

script.zs
// MobEffect.addAttributeModifier(attribute as Attribute, id as ResourceLocation, value as double, operation as AttributeOperation) as MobEffect;
myMobEffect.addAttributeModifier(myAttribute, myResourceLocation, myDouble, myOperation);

Parameters:

attribute Type: Attribute - The attribute to add the modifier to.
id Type: ResourceLocation - The ID of the modifier.
value Type: double - The value of the modifier.
operation Type: AttributeOperation - The operation to apply to the modifier.

Return Type: MobEffect

applyEffectTick(entity as LivingEntity, amplifier as int)
Applies the effect to the entity.
script.zs
// MobEffect.applyEffectTick(entity as LivingEntity, amplifier as int);
myMobEffect.applyEffectTick(myLivingEntity, myInt);

Parameters:

entity Type: LivingEntity - The entity to apply the effect to.
amplifier Type: int - The amplifier of the effect.
applyInstantenousEffect(source as Entity, indirectSource as Entity, target as LivingEntity, amplifier as int, effectiveness as double)
Applies the effect to the entity.
script.zs
// MobEffect.applyInstantenousEffect(source as Entity, indirectSource as Entity, target as LivingEntity, amplifier as int, effectiveness as double);
myMobEffect.applyInstantenousEffect(myEntity, myEntity, myLivingEntity, myInt, myDouble);

Parameters:

source Type: Entity - The source of the effect.
indirectSource Type: Entity - The indirect source of the effect.
target Type: LivingEntity - The target of the effect.
amplifier Type: int - The amplifier of the effect.
effectiveness Type: double - The effectiveness of the effect.
Getter
Checks if the effect is beneficial.
script.zs
// MobEffect.beneficial as bool
myMobEffect.beneficial

Return Type: bool

beneficial() as bool
Checks if the effect is beneficial.

Returns: True if the effect is beneficial, false otherwise.

script.zs
// MobEffect.beneficial() as bool;
myMobEffect.beneficial();

Return Type: bool

Getter
Gets the MobEffectCategory of the effect.
script.zs
// MobEffect.category as MobEffectCategory
myMobEffect.category

Return Type: MobEffectCategory

category() as MobEffectCategory
Gets the MobEffectCategory of the effect.

Returns: The MobEffectCategory of the effect.

script.zs
// MobEffect.category() as MobEffectCategory;
myMobEffect.category();

Return Type: MobEffectCategory

Getter
Gets the color of the effect.
script.zs
// MobEffect.color as int
myMobEffect.color

Return Type: int

color() as int
Gets the color of the effect.

Returns: The color of the effect.

script.zs
// MobEffect.color() as int;
myMobEffect.color();

Return Type: int

Getter
Gets the command string of the effect.
script.zs
// MobEffect.commandString as string
myMobEffect.commandString

Return Type: string

commandString() as string
Gets the command string of the effect.

Returns: The command string of the effect.

script.zs
// MobEffect.commandString() as string;
myMobEffect.commandString();

Return Type: string

Getter
Gets the description ID of the effect.
script.zs
// MobEffect.descriptionId as string
myMobEffect.descriptionId

Return Type: string

descriptionId() as string
Gets the description ID of the effect.

Returns: The description ID of the effect.

script.zs
// MobEffect.descriptionId() as string;
myMobEffect.descriptionId();

Return Type: string

Getter
Gets the display name of the effect.
script.zs
// MobEffect.displayName as Component
myMobEffect.displayName

Return Type: Component

displayName() as Component
Gets the display name of the effect.

Returns: The display name of the effect.

script.zs
// MobEffect.displayName() as Component;
myMobEffect.displayName();

Return Type: Component

getAttributeModifiers(amplifier as int) as AttributeModifier[Attribute]
Gets the AttributeModifier that this effect adds with the given amplifier.

Returns: The AttributeModifier that this effect adds with the given amplifier.

script.zs
// MobEffect.getAttributeModifiers(amplifier as int) as AttributeModifier[Attribute];
myMobEffect.getAttributeModifiers(myInt);

Parameters:

amplifier Type: int - The amplifier of the effect.

Return Type: AttributeModifier[Attribute]

Getter
Checks if the effect is instantenous.
script.zs
// MobEffect.instantenous as bool
myMobEffect.instantenous

Return Type: bool

instantenous() as bool
Checks if the effect is instantenous.

Returns: True if the effect is instantenous, false otherwise.

script.zs
// MobEffect.instantenous() as bool;
myMobEffect.instantenous();

Return Type: bool

Getter
Gets the registry name of the effect.
script.zs
// MobEffect.registryName as ResourceLocation
myMobEffect.registryName

Return Type: ResourceLocation

registryName() as ResourceLocation
Gets the registry name of the effect.

Returns: The registry name of the effect.

script.zs
// MobEffect.registryName() as ResourceLocation;
myMobEffect.registryName();

Return Type: ResourceLocation

shouldApplyEffectTickThisTick(duration as int, amplifier as int) as bool
Checks if the effect should be applied this tick.

Returns: True if the effect should be applied this tick, false otherwise.

script.zs
// MobEffect.shouldApplyEffectTickThisTick(duration as int, amplifier as int) as bool;
myMobEffect.shouldApplyEffectTickThisTick(myInt, myInt);

Parameters:

duration Type: int - The duration of the effect.
amplifier Type: int - The amplifier of the effect.

Return Type: bool