MobEffectInstance
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
import crafttweaker.api.entity.effect.MobEffectInstance;Description
A MobEffectInstance is a wrapper around aMobEffect that has a duration, amplifier, and other properties. Implements
Undocumented Interfaces
Comparable<MobEffectInstance>
Members
MobEffectInstance is ambient.// MobEffectInstance.ambient as boolmyMobEffectInstance.ambient
Return Type:
bool
MobEffectInstance is ambient.Returns: True if the MobEffectInstance is ambient, false otherwise.
// MobEffectInstance.ambient() as bool;myMobEffectInstance.ambient();
Return Type:
bool
MobEffectInstance.// MobEffectInstance.amplifier as intmyMobEffectInstance.amplifier
Return Type:
int
MobEffectInstance.Returns: The amplifier of the MobEffectInstance.
// MobEffectInstance.amplifier() as int;myMobEffectInstance.amplifier();
Return Type:
int
MobEffectInstance to another MobEffectInstance.Returns: The result of the comparison.
myMobEffectInstance.compareTo(myMobEffectInstance);Parameters:
Return Type:
int
MobEffectInstance.// MobEffectInstance.descriptionId as stringmyMobEffectInstance.descriptionId
Return Type:
string
MobEffectInstance.Returns: The description ID of the MobEffectInstance.
// MobEffectInstance.descriptionId() as string;myMobEffectInstance.descriptionId();
Return Type:
string
MobEffectInstance.// MobEffectInstance.duration as intmyMobEffectInstance.duration
Return Type:
int
MobEffectInstance.Returns: The duration of the MobEffectInstance.
// MobEffectInstance.duration() as int;myMobEffectInstance.duration();
Return Type:
int
MobEffect of the MobEffectInstance.// MobEffectInstance.effect as MobEffectmyMobEffectInstance.effect
Return Type:
MobEffect
MobEffect of the MobEffectInstance.Returns: The MobEffect of the MobEffectInstance.
myMobEffectInstance.effect();
Return Type:
MobEffect
MobEffectInstance from a MapData.Returns: The MobEffectInstance loaded from the MapData.
MobEffectInstance.load(myMapData);Parameters:
Return Type:
MobEffectInstance
MobEffectInstance.Returns: A new MobEffectInstance.
// MobEffectInstance.of(mobEffect as MobEffect, duration as int = 0, amplifier as int = 0, ambient as bool = false, visible as bool = true, showIcon as bool = true, hiddenEffect as MobEffectInstance = null) as MobEffectInstance;MobEffectInstance.of(myMobEffect, myInt, myInt, myBool, myBool, myBool, myMobEffectInstance);Parameters:
duration: int (optional) Type: int
- The duration of the effect.
Default Value: 0
amplifier: int (optional) Type: int
- The amplifier of the effect.
Default Value: 0
ambient: bool (optional) Type: bool
- Whether the effect is ambient.
Default Value: false
visible: bool (optional) Type: bool
- Whether the effect is visible.
Default Value: true
showIcon: bool (optional) Type: bool
- Whether the effect should show an icon.
Default Value: true
hiddenEffect: MobEffectInstance (optional) Type: MobEffectInstance
- The hidden effect of the effect.
Default Value: null
Return Type:
MobEffectInstance
MobEffectInstance to a MapData.Returns: The MapData representation of the MobEffectInstance.
myMobEffectInstance.save();
Return Type:
MapData
MobEffectInstance should show an icon.// MobEffectInstance.showIcon as boolmyMobEffectInstance.showIcon
Return Type:
bool
MobEffectInstance should show an icon.Returns: True if the MobEffectInstance should show an icon, false otherwise.
// MobEffectInstance.showIcon() as bool;myMobEffectInstance.showIcon();
Return Type:
bool
MobEffectInstance for the given LivingEntity.Returns: True if the MobEffectInstance was ticked, false otherwise.
myMobEffectInstance.tick(myLivingEntity, myRunnable);Parameters:
onFinish: Runnable (optional) Type: Runnable
- The Runnable to run when the MobEffectInstance finishes.
Default Value: null
Return Type:
bool
MobEffectInstance with the given MobEffectInstance.Returns: True if the MobEffectInstance was updated, false otherwise.
myMobEffectInstance.update(myMobEffectInstance);Parameters:
Return Type:
bool
MobEffectInstance is visible.// MobEffectInstance.visible as boolmyMobEffectInstance.visible
Return Type:
bool
MobEffectInstance is visible.Returns: True if the MobEffectInstance is visible, false otherwise.
// MobEffectInstance.visible() as bool;myMobEffectInstance.visible();
Return Type:
bool