Package net.minecraft.world.effect
Class MobEffectInstance
java.lang.Object
net.minecraft.world.effect.MobEffectInstance
- All Implemented Interfaces:
Comparable<MobEffectInstance>
,IForgeMobEffectInstance
public class MobEffectInstance
extends Object
implements Comparable<MobEffectInstance>, IForgeMobEffectInstance
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private int
(package private) int
private final MobEffect
private final Optional<MobEffectInstance.FactorData>
private MobEffectInstance
private static final org.slf4j.Logger
private boolean
private boolean
-
Constructor Summary
ConstructorDescriptionMobEffectInstance
(MobEffect p_19513_) MobEffectInstance
(MobEffectInstance p_19543_) MobEffectInstance
(MobEffect p_19515_, int p_19516_) MobEffectInstance
(MobEffect p_19518_, int p_19519_, int p_19520_) MobEffectInstance
(MobEffect p_19522_, int p_19523_, int p_19524_, boolean p_19525_, boolean p_19526_) MobEffectInstance
(MobEffect p_19528_, int p_19529_, int p_19530_, boolean p_19531_, boolean p_19532_, boolean p_19533_) MobEffectInstance
(MobEffect p_216887_, int p_216888_, int p_216889_, boolean p_216890_, boolean p_216891_, boolean p_216892_, MobEffectInstance p_216893_, Optional<MobEffectInstance.FactorData> p_216894_) -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyEffect
(LivingEntity p_19551_) int
compareTo
(MobEffectInstance p_19566_) boolean
int
Returns a list of curative items for the potion effect By default, this list is initialized usingIForgeMobEffect.getCurativeItems()
int
int
hashCode()
boolean
boolean
static MobEffectInstance
load
(CompoundTag p_19561_) private static MobEffectInstance
loadSpecifiedEffect
(MobEffect p_19546_, CompoundTag p_19547_) private static MobEffectInstance
readCurativeItems
(MobEffectInstance effect, CompoundTag nbt) save
(CompoundTag p_19556_) void
setCurativeItems
(List<ItemStack> curativeItems) Sets the list of curative items for this potion effect, overwriting any already present(package private) void
setDetailsFrom
(MobEffectInstance p_19549_) boolean
showIcon()
boolean
tick
(LivingEntity p_19553_, Runnable p_19554_) private int
toString()
boolean
update
(MobEffectInstance p_19559_) private void
writeDetailsTo
(CompoundTag p_19568_) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraftforge.common.extensions.IForgeMobEffectInstance
addCurativeItem, isCurativeItem, writeCurativeItems
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
effect
-
duration
int duration -
amplifier
private int amplifier -
ambient
private boolean ambient -
visible
private boolean visible -
showIcon
private boolean showIcon -
factorData
-
curativeItems
-
-
Constructor Details
-
MobEffectInstance
-
MobEffectInstance
-
MobEffectInstance
-
MobEffectInstance
public MobEffectInstance(MobEffect p_19522_, int p_19523_, int p_19524_, boolean p_19525_, boolean p_19526_) -
MobEffectInstance
public MobEffectInstance(MobEffect p_19528_, int p_19529_, int p_19530_, boolean p_19531_, boolean p_19532_, boolean p_19533_) -
MobEffectInstance
public MobEffectInstance(MobEffect p_216887_, int p_216888_, int p_216889_, boolean p_216890_, boolean p_216891_, boolean p_216892_, @Nullable MobEffectInstance p_216893_, Optional<MobEffectInstance.FactorData> p_216894_) -
MobEffectInstance
-
-
Method Details
-
getFactorData
-
setDetailsFrom
-
update
-
getEffect
-
getDuration
public int getDuration() -
getAmplifier
public int getAmplifier() -
isAmbient
public boolean isAmbient() -
isVisible
public boolean isVisible() -
showIcon
public boolean showIcon() -
tick
-
tickDownDuration
private int tickDownDuration() -
applyEffect
-
getDescriptionId
-
toString
-
equals
-
hashCode
public int hashCode() -
save
-
writeDetailsTo
-
load
-
loadSpecifiedEffect
-
compareTo
- Specified by:
compareTo
in interfaceComparable<MobEffectInstance>
-
getCurativeItems
Description copied from interface:IForgeMobEffectInstance
Returns a list of curative items for the potion effect By default, this list is initialized usingIForgeMobEffect.getCurativeItems()
- Specified by:
getCurativeItems
in interfaceIForgeMobEffectInstance
- Returns:
- The list (ItemStack) of curative items for the potion effect
-
setCurativeItems
Description copied from interface:IForgeMobEffectInstance
Sets the list of curative items for this potion effect, overwriting any already present- Specified by:
setCurativeItems
in interfaceIForgeMobEffectInstance
- Parameters:
curativeItems
- The list of ItemStacks being set to the potion effect
-
readCurativeItems
-