MobEffect

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.

script.zs
import crafttweaker.api.entity.effect.MobEffect;

Methods

Return Type: MobEffect

script.zs
MobEffect.addAttributeModifier(attribute as Attribute, name as string, value as double, operation as AttributeOperation) as MobEffect
ParameterType
Parameter
attribute
Type
Attribute
Parameter
name
Type
string
Parameter
value
Type
double
Parameter
operation
Type
AttributeOperation
script.zs
MobEffect.applyEffectTick(entity as LivingEntity, amplifier as int)
ParameterType
Parameter
entity
Type
LivingEntity
Parameter
amplifier
Type
int
script.zs
MobEffect.applyInstantenousEffect(source as Entity, indirectSource as Entity, target as LivingEntity, amplifier as int, effectiveness as double)
ParameterType
Parameter
source
Type
Entity
Parameter
indirectSource
Type
Entity
Parameter
target
Type
LivingEntity
Parameter
amplifier
Type
int
Parameter
effectiveness
Type
double

Return Type: double

script.zs
MobEffect.getAttributeModifierValue(amplifier as int, modifier as AttributeModifier) as double
ParameterType
Parameter
amplifier
Type
int
Parameter
modifier
Type
AttributeModifier

Return Type: AttributeModifier[Attribute]

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

Return Type: MobEffectCategory

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

Return Type: int

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

Return Type: string

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

Return Type: Component

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

Return Type: ResourceLocation

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

Return Type: boolean

script.zs
// MobEffect.isBeneficial() as boolean
myMobEffect.isBeneficial();

Return Type: boolean

script.zs
MobEffect.isDurationEffectTick(duration as int, amplifier as int) as boolean
ParameterType
Parameter
duration
Type
int
Parameter
amplifier
Type
int

Return Type: boolean

script.zs
// MobEffect.isInstantenous() as boolean
myMobEffect.isInstantenous();

Properties

NameTypeHas GetterHas Setter
Name
beneficial
Type
boolean
Has Getter
true
Has Setter
false
Name
category
Type
MobEffectCategory
Has Getter
true
Has Setter
false
Name
color
Type
int
Has Getter
true
Has Setter
false
Name
commandString
Type
string
Has Getter
true
Has Setter
false
Name
descriptionId
Type
string
Has Getter
true
Has Setter
false
Name
displayName
Type
Component
Has Getter
true
Has Setter
false
Name
instantenous
Type
boolean
Has Getter
true
Has Setter
false
Name
registryName
Type
ResourceLocation
Has Getter
true
Has Setter
false