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 #地图数据
描述
No Description Provided

Constructor #构造函数

Link to constructor-构造函数

ZenScript
Copy
new MobEffectInstance(mobEffect as MobEffect) as MobEffectInstance
new MobEffectInstance(<mobeffect:minecraft:haste>);
参数类型描述
参数
mobEffect
类型
MobEffect
描述
No description provided
ZenScript
Copy
new MobEffectInstance(mobEffect as MobEffect, duration as int) as MobEffectInstance
new MobEffectInstance(<mobeffect:minecraft:haste>, 100);
参数类型描述
参数
mobEffect
类型
MobEffect
描述
No description provided
参数
duration
类型
int
描述
No description provided
ZenScript
Copy
new MobEffectInstance(mobEffect as MobEffect, duration as int, amplifier as int) as MobEffectInstance
new MobEffectInstance(<mobeffect:minecraft:haste>, 100, 2);
参数类型描述
参数
mobEffect
类型
MobEffect
描述
No description provided
参数
duration
类型
int
描述
No description provided
参数
amplifier
类型
int
描述
No description provided
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
描述
No description provided
参数
duration
类型
int
描述
No description provided
参数
amplifier
类型
int
描述
No description provided
参数
ambient
类型
布尔值
描述
No description provided
参数
visible
类型
布尔值
描述
No description provided
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
描述
No description provided
参数
duration
类型
int
描述
No description provided
参数
amplifier
类型
int
描述
No description provided
参数
ambient
类型
布尔值
描述
No description provided
参数
visible
类型
布尔值
描述
No description provided
参数
showIcon
类型
布尔值
描述
No description provided
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
描述
No description provided
参数
duration
类型
int
描述
No description provided
参数
amplifier
类型
int
描述
No description provided
参数
ambient
类型
布尔值
描述
No description provided
参数
visible
类型
布尔值
描述
No description provided
参数
showIcon
类型
布尔值
描述
No description provided
参数
hiddenEffect
类型
MobEffectInstance
描述
No description provided

Name: applyEffect

Return Type: void

ZenScript
Copy
MobEffectInstance.applyEffect(entity as LivingEntity) as void
参数类型描述
参数
entity
类型
LivingEntity
描述
No Description Provided

Name: compareTo

Return Type: int

ZenScript
Copy
MobEffectInstance.compareTo(other as MobEffectInstance) as int
参数类型描述
参数
other
类型
MobEffectInstance
描述
No Description Provided

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
参数类型描述可选DefaultValue
参数
data
类型
MapData #地图数据
描述
No Description Provided
可选
true
DefaultValue

Name: setNoCounter

Return Type: void

ZenScript
Copy
MobEffectInstance.setNoCounter(noCounter as boolean) as void
参数类型描述
参数
noCounter
类型
布尔值
描述
No Description Provided

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 invalid) as boolean
参数类型描述可选DefaultValue
参数
entity
类型
LivingEntity
描述
No Description Provided
可选
false
DefaultValue
参数
onFinish
类型
invalid
描述
No Description Provided
可选
true
DefaultValue
null

Name: update

Return Type: boolean

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