MobEffectInstance
Link to mobeffectinstance
导入类
Link to 导入类
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 Copyimport 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
- Comparable<MobEffectInstance>
Static Methods
Link to static-methods
Name: load
Return Type: MobEffectInstance
ZenScript CopyMobEffectInstance.load(data as MapData) as MobEffectInstance
参数 | 类型 |
---|---|
参数 data | 类型 MapData #地图数据 |
Constructor #构造函数
Link to constructor-构造函数
ZenScript Copynew MobEffectInstance(mobEffect as MobEffect) as MobEffectInstance
new MobEffectInstance(<mobeffect:minecraft:haste>);
参数 | 类型 |
---|---|
参数 mobEffect | 类型 MobEffect |
ZenScript Copynew MobEffectInstance(mobEffect as MobEffect, duration as int) as MobEffectInstance
new MobEffectInstance(<mobeffect:minecraft:haste>, 100);
参数 | 类型 |
---|---|
参数 mobEffect | 类型 MobEffect |
参数 duration | 类型 int |
ZenScript Copynew 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 Copynew 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 Copynew 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 Copynew 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 |
使用方式
Link to 使用方式
Name: applyEffect
ZenScript CopyMobEffectInstance.applyEffect(entity as LivingEntity)
参数 | 类型 |
---|---|
参数 entity | 类型 LivingEntity |
Name: compareTo
Return Type: int
ZenScript CopyMobEffectInstance.compareTo(other as MobEffectInstance) as int
参数 | 类型 |
---|---|
参数 other | 类型 MobEffectInstance |
Name: getAmplifier
Return Type: int
ZenScript Copy// MobEffectInstance.getAmplifier() as int
myMobEffectInstance.getAmplifier();
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: setNoCounter
ZenScript CopyMobEffectInstance.setNoCounter(noCounter as boolean)
参数 | 类型 |
---|---|
参数 noCounter | 类型 布尔值 |
Name: showIcon
Return Type: boolean
ZenScript Copy// MobEffectInstance.showIcon() as boolean
myMobEffectInstance.showIcon();
Name: tick
Return Type: boolean
ZenScript CopyMobEffectInstance.tick(entity as LivingEntity, onFinish as Runnable?) as boolean
参数 | 类型 | 可选 | 默认值 |
---|---|---|---|
参数 entity | 类型 LivingEntity | 可选 false | 默认值 |
参数 onFinish | 类型 Runnable? | 可选 true | 默认值 null |
Name: update
Return Type: boolean
ZenScript CopyMobEffectInstance.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 |