Importing the class

Link to 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.

ZenScript
Copy
import crafttweaker.api.entity.effect.MobEffect;

Link to addAttributeModifier

Name: addAttributeModifier

Return Type: MobEffect

ZenScript
Copy
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

Name: applyEffectTick

ZenScript
Copy
MobEffect.applyEffectTick(entity as LivingEntity, amplifier as int)
ParameterType
Parameter
entity
Type
LivingEntity
Parameter
amplifier
Type
int

Link to applyInstantenousEffect

Name: applyInstantenousEffect

ZenScript
Copy
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

Link to getAttributeModifiers

Name: getAttributeModifiers

Return Type: AttributeModifier[Attribute]

ZenScript
Copy
MobEffect.getAttributeModifiers(amplifier as int) as AttributeModifier[Attribute]
ParameterType
Parameter
amplifier
Type
int

Name: getCategory

Return Type: MobEffectCategory

ZenScript
Copy
// MobEffect.getCategory() as MobEffectCategory

myMobEffect.getCategory();

Name: getColor

Return Type: int

ZenScript
Copy
// MobEffect.getColor() as int

myMobEffect.getColor();

Link to getDescriptionId

Name: getDescriptionId

Return Type: string

ZenScript
Copy
// MobEffect.getDescriptionId() as string

myMobEffect.getDescriptionId();

Name: getDisplayName

Return Type: Component

ZenScript
Copy
// MobEffect.getDisplayName() as Component

myMobEffect.getDisplayName();

Name: getRegistryName

Return Type: ResourceLocation

ZenScript
Copy
// MobEffect.getRegistryName() as ResourceLocation

myMobEffect.getRegistryName();

Name: isBeneficial

Return Type: boolean

ZenScript
Copy
// MobEffect.isBeneficial() as boolean

myMobEffect.isBeneficial();

Name: isInstantenous

Return Type: boolean

ZenScript
Copy
// MobEffect.isInstantenous() as boolean

myMobEffect.isInstantenous();

Link to shouldApplyEffectTickThisTick

Name: shouldApplyEffectTickThisTick

Return Type: boolean

ZenScript
Copy
MobEffect.shouldApplyEffectTickThisTick(duration as int, amplifier as int) as boolean
ParameterType
Parameter
duration
Type
int
Parameter
amplifier
Type
int
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