MobEffectInstance

Link to mobeffectinstance

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

已实现的接口

Link to 已实现的接口

MobEffectInstance implements the following interfaces. That means all methods defined in these interfaces are also available in MobEffectInstance

Name: load

Return Type: MobEffectInstance

ZenScript
Copy
MobEffectInstance.load(data as MapData) as MobEffectInstance
参数类型
参数
data
类型
MapData #地图数据

Constructor #构造函数

Link to constructor-构造函数

ZenScript
Copy
new MobEffectInstance(mobEffect as MobEffect) as MobEffectInstance
new MobEffectInstance(<mobeffect:minecraft:haste>);
参数类型
参数
mobEffect
类型
MobEffect
ZenScript
Copy
new MobEffectInstance(mobEffect as MobEffect, duration as int) as MobEffectInstance
new MobEffectInstance(<mobeffect:minecraft:haste>, 100);
参数类型
参数
mobEffect
类型
MobEffect
参数
duration
类型
int
ZenScript
Copy
new MobEffectInstance(mobEffect as MobEffect, duration as int, amplifier as int) as MobEffectInstance
new MobEffectInstance(<mobeffect:minecraft:haste>, 100, 2);
参数类型
参数
mobEffect
类型
MobEffect
参数
duration
类型
int
参数
amplifier
类型
int
ZenScript
Copy
new MobEffectInstance(mobEffect as MobEffect, duration as int, amplifier as int, ambient as boolean, visible as boolean) as MobEffectInstance
new MobEffectInstance(<mobeffect:minecraft:haste>, 100, 2, true, false);
参数类型
参数
mobEffect
类型
MobEffect
参数
duration
类型
int
参数
amplifier
类型
int
参数
ambient
类型
布尔值
参数
visible
类型
布尔值
ZenScript
Copy
new MobEffectInstance(mobEffect as MobEffect, duration as int, amplifier as int, ambient as boolean, visible as boolean, showIcon as boolean) as MobEffectInstance
new MobEffectInstance(<mobeffect:minecraft:haste>, 100, 2, true, false, false);
参数类型
参数
mobEffect
类型
MobEffect
参数
duration
类型
int
参数
amplifier
类型
int
参数
ambient
类型
布尔值
参数
visible
类型
布尔值
参数
showIcon
类型
布尔值
ZenScript
Copy
new MobEffectInstance(mobEffect as MobEffect, duration as int, amplifier as int, ambient as boolean, visible as boolean, showIcon as boolean, hiddenEffect as MobEffectInstance) as MobEffectInstance
new MobEffectInstance(<mobeffect:minecraft:haste>, 100, 2, true, false, false, new MobEffectInstance(<mobeffect:minecraft:haste>, 200, 3));
参数类型
参数
mobEffect
类型
MobEffect
参数
duration
类型
int
参数
amplifier
类型
int
参数
ambient
类型
布尔值
参数
visible
类型
布尔值
参数
showIcon
类型
布尔值
参数
hiddenEffect
类型
MobEffectInstance

Name: applyEffect

ZenScript
Copy
MobEffectInstance.applyEffect(entity as LivingEntity)
参数类型
参数
entity
类型
LivingEntity

Name: compareTo

Return Type: int

ZenScript
Copy
MobEffectInstance.compareTo(other as MobEffectInstance) as int
参数类型
参数
other
类型
MobEffectInstance

Name: getAmplifier

Return Type: int

ZenScript
Copy
// MobEffectInstance.getAmplifier() as int

myMobEffectInstance.getAmplifier();

Link to getDescriptionId

Name: getDescriptionId

Return Type: string

ZenScript
Copy
// MobEffectInstance.getDescriptionId() as string

myMobEffectInstance.getDescriptionId();

Name: getDuration

Return Type: int

ZenScript
Copy
// MobEffectInstance.getDuration() as int

myMobEffectInstance.getDuration();

Name: getEffect

Return Type: MobEffect

ZenScript
Copy
// MobEffectInstance.getEffect() as MobEffect

myMobEffectInstance.getEffect();

Name: isAmbient

Return Type: boolean

ZenScript
Copy
// MobEffectInstance.isAmbient() as boolean

myMobEffectInstance.isAmbient();

Name: isNoCounter

Return Type: boolean

ZenScript
Copy
// MobEffectInstance.isNoCounter() as boolean

myMobEffectInstance.isNoCounter();

Name: isVisible

Return Type: boolean

ZenScript
Copy
// MobEffectInstance.isVisible() as boolean

myMobEffectInstance.isVisible();

Name: save

Return Type: MapData

ZenScript
Copy
MobEffectInstance.save(data as MapData?) as MapData
参数类型可选
参数
data
类型
MapData?
可选
true

Name: setNoCounter

ZenScript
Copy
MobEffectInstance.setNoCounter(noCounter as boolean)
参数类型
参数
noCounter
类型
布尔值

Name: showIcon

Return Type: boolean

ZenScript
Copy
// MobEffectInstance.showIcon() as boolean

myMobEffectInstance.showIcon();

Name: tick

Return Type: boolean

ZenScript
Copy
MobEffectInstance.tick(entity as LivingEntity, onFinish as Runnable?) as boolean
参数类型可选默认值
参数
entity
类型
LivingEntity
可选
false
默认值
参数
onFinish
类型
Runnable?
可选
true
默认值
null

Name: update

Return Type: boolean

ZenScript
Copy
MobEffectInstance.update(instance as MobEffectInstance) as boolean
参数类型
参数
instance
类型
MobEffectInstance
名称类型可获得可设置
名称
ambient
类型
布尔值
可获得
true
可设置
false
名称
amplifier
类型
int
可获得
true
可设置
false
名称
descriptionId
类型
string
可获得
true
可设置
false
名称
duration
类型
int
可获得
true
可设置
false
名称
effect
类型
MobEffect
可获得
true
可设置
false
名称
isNoCounter
类型
布尔值
可获得
true
可设置
false
名称
showIcon
类型
布尔值
可获得
true
可设置
false
名称
visible
类型
布尔值
可获得
true
可设置
false