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
参数类型
参数
attribute
类型
Attribute
参数
name(名称)
类型
string
参数
value
类型
double
参数
operation
类型
AttributeOperation

Name: applyEffectTick

ZenScript
Copy
MobEffect.applyEffectTick(entity as LivingEntity, amplifier as int)
参数类型
参数
entity
类型
LivingEntity
参数
amplifier
类型
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)
参数类型
参数
来源
类型
Entity
参数
indirectSource
类型
Entity
参数
target
类型
LivingEntity
参数
amplifier
类型
int
参数
effectiveness
类型
double

Link to getAttributeModifierValue

Name: getAttributeModifierValue

Return Type: double

ZenScript
Copy
MobEffect.getAttributeModifierValue(amplifier as int, modifier as AttributeModifier) as double
参数类型
参数
amplifier
类型
int
参数
modifier
类型
AttributeModifier

Link to getAttributeModifiers

Name: getAttributeModifiers

Return Type: AttributeModifier[Attribute]

ZenScript
Copy
// MobEffect.getAttributeModifiers() as AttributeModifier[Attribute]

myMobEffect.getAttributeModifiers();

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();

Link to isDurationEffectTick

Name: isDurationEffectTick

Return Type: boolean

ZenScript
Copy
MobEffect.isDurationEffectTick(duration as int, amplifier as int) as boolean
参数类型
参数
duration
类型
int
参数
amplifier
类型
int

Name: isInstantenous

Return Type: boolean

ZenScript
Copy
// MobEffect.isInstantenous() as boolean

myMobEffect.isInstantenous();
名称类型可获得可设置
名称
beneficial
类型
布尔值
可获得
true
可设置
false
名称
category
类型
MobEffectCategory
可获得
true
可设置
false
名称
color
类型
int
可获得
true
可设置
false
名称
commandString #命令字符串
类型
string
可获得
true
可设置
false
名称
descriptionId
类型
string
可获得
true
可设置
false
名称
displayName
类型
Component
可获得
true
可设置
false
名称
instantenous
类型
布尔值
可获得
true
可设置
false
名称
registryName
类型
资源位置
可获得
true
可设置
false