InstantenousMobEffect

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

Extends

InstantenousMobEffect extends 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
// InstantenousMobEffect.addAttributeModifier(attribute as Attribute, id as ResourceLocation, value as double, operation as AttributeOperation) as MobEffect;
myInstantenousMobEffect.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
// InstantenousMobEffect.applyEffectTick(entity as LivingEntity, amplifier as int);
myInstantenousMobEffect.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
// InstantenousMobEffect.applyInstantenousEffect(source as Entity, indirectSource as Entity, target as LivingEntity, amplifier as int, effectiveness as double);
myInstantenousMobEffect.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
// InstantenousMobEffect.beneficial as bool
myInstantenousMobEffect.beneficial

Return Type: bool

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

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

script.zs
// InstantenousMobEffect.beneficial() as bool;
myInstantenousMobEffect.beneficial();

Return Type: bool

Getter
Gets the MobEffectCategory of the effect.
script.zs
// InstantenousMobEffect.category as MobEffectCategory
myInstantenousMobEffect.category

Return Type: MobEffectCategory

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

Returns: The MobEffectCategory of the effect.

script.zs
// InstantenousMobEffect.category() as MobEffectCategory;
myInstantenousMobEffect.category();

Return Type: MobEffectCategory

Getter
Gets the color of the effect.
script.zs
// InstantenousMobEffect.color as int
myInstantenousMobEffect.color

Return Type: int

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

Returns: The color of the effect.

script.zs
// InstantenousMobEffect.color() as int;
myInstantenousMobEffect.color();

Return Type: int

Getter
Gets the command string of the effect.
script.zs
// InstantenousMobEffect.commandString as string
myInstantenousMobEffect.commandString

Return Type: string

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

Returns: The command string of the effect.

script.zs
// InstantenousMobEffect.commandString() as string;
myInstantenousMobEffect.commandString();

Return Type: string

Getter
Gets the description ID of the effect.
script.zs
// InstantenousMobEffect.descriptionId as string
myInstantenousMobEffect.descriptionId

Return Type: string

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

Returns: The description ID of the effect.

script.zs
// InstantenousMobEffect.descriptionId() as string;
myInstantenousMobEffect.descriptionId();

Return Type: string

Getter
Gets the display name of the effect.
script.zs
// InstantenousMobEffect.displayName as Component
myInstantenousMobEffect.displayName

Return Type: Component

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

Returns: The display name of the effect.

script.zs
// InstantenousMobEffect.displayName() as Component;
myInstantenousMobEffect.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
// InstantenousMobEffect.getAttributeModifiers(amplifier as int) as AttributeModifier[Attribute];
myInstantenousMobEffect.getAttributeModifiers(myInt);

Parameters:

amplifier Type: int - The amplifier of the effect.

Return Type: AttributeModifier[Attribute]

Getter
Checks if the effect is instantenous.
script.zs
// InstantenousMobEffect.instantenous as bool
myInstantenousMobEffect.instantenous

Return Type: bool

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

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

script.zs
// InstantenousMobEffect.instantenous() as bool;
myInstantenousMobEffect.instantenous();

Return Type: bool

Getter
Gets the registry name of the effect.
script.zs
// InstantenousMobEffect.registryName as ResourceLocation
myInstantenousMobEffect.registryName

Return Type: ResourceLocation

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

Returns: The registry name of the effect.

script.zs
// InstantenousMobEffect.registryName() as ResourceLocation;
myInstantenousMobEffect.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
// InstantenousMobEffect.shouldApplyEffectTickThisTick(duration as int, amplifier as int) as bool;
myInstantenousMobEffect.shouldApplyEffectTickThisTick(myInt, myInt);

Parameters:

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

Return Type: bool