Class EffectInstance

java.lang.Object
net.minecraft.potion.EffectInstance
All Implemented Interfaces:
Comparable<EffectInstance>, IForgeEffectInstance

public class EffectInstance extends Object implements Comparable<EffectInstance>, IForgeEffectInstance
  • Field Details

    • LOGGER

      private static final org.apache.logging.log4j.Logger LOGGER
    • effect

      private final Effect effect
    • duration

      private int duration
    • amplifier

      private int amplifier
    • splash

      private boolean splash
    • ambient

      private boolean ambient
    • noCounter

      private boolean noCounter
    • visible

      private boolean visible
    • showIcon

      private boolean showIcon
    • hiddenEffect

      @Nullable private EffectInstance hiddenEffect
    • curativeItems

      private List<ItemStack> curativeItems
  • Constructor Details

    • EffectInstance

      public EffectInstance(Effect p_i46811_1_)
    • EffectInstance

      public EffectInstance(Effect p_i46812_1_, int p_i46812_2_)
    • EffectInstance

      public EffectInstance(Effect p_i46813_1_, int p_i46813_2_, int p_i46813_3_)
    • EffectInstance

      public EffectInstance(Effect p_i46814_1_, int p_i46814_2_, int p_i46814_3_, boolean p_i46814_4_, boolean p_i46814_5_)
    • EffectInstance

      public EffectInstance(Effect p_i48980_1_, int p_i48980_2_, int p_i48980_3_, boolean p_i48980_4_, boolean p_i48980_5_, boolean p_i48980_6_)
    • EffectInstance

      public EffectInstance(Effect p_i230050_1_, int p_i230050_2_, int p_i230050_3_, boolean p_i230050_4_, boolean p_i230050_5_, boolean p_i230050_6_, @Nullable EffectInstance p_i230050_7_)
    • EffectInstance

      public EffectInstance(EffectInstance p_i1577_1_)
  • Method Details

    • setDetailsFrom

      void setDetailsFrom(EffectInstance p_230117_1_)
    • update

      public boolean update(EffectInstance p_199308_1_)
    • getEffect

      public Effect getEffect()
    • getDuration

      public int getDuration()
    • getAmplifier

      public int getAmplifier()
    • isAmbient

      public boolean isAmbient()
    • isVisible

      public boolean isVisible()
    • showIcon

      public boolean showIcon()
    • tick

      public boolean tick(LivingEntity p_76455_1_, Runnable p_76455_2_)
    • tickDownDuration

      private int tickDownDuration()
    • applyEffect

      public void applyEffect(LivingEntity p_76457_1_)
    • getDescriptionId

      public String getDescriptionId()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object p_equals_1_)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • save

      public CompoundNBT save(CompoundNBT p_82719_1_)
    • writeDetailsTo

      private void writeDetailsTo(CompoundNBT p_230119_1_)
    • load

      public static EffectInstance load(CompoundNBT p_82722_0_)
    • loadSpecifiedEffect

      private static EffectInstance loadSpecifiedEffect(Effect p_230116_0_, CompoundNBT p_230116_1_)
    • setNoCounter

      public void setNoCounter(boolean p_100012_1_)
    • isNoCounter

      public boolean isNoCounter()
    • compareTo

      public int compareTo(EffectInstance p_compareTo_1_)
      Specified by:
      compareTo in interface Comparable<EffectInstance>
    • getCurativeItems

      public List<ItemStack> getCurativeItems()
      Description copied from interface: IForgeEffectInstance
      Returns a list of curative items for the potion effect By default, this list is initialized using Potion#getCurativeItems
      Specified by:
      getCurativeItems in interface IForgeEffectInstance
      Returns:
      The list (ItemStack) of curative items for the potion effect
    • setCurativeItems

      public void setCurativeItems(List<ItemStack> curativeItems)
      Description copied from interface: IForgeEffectInstance
      Sets the list of curative items for this potion effect, overwriting any already present
      Specified by:
      setCurativeItems in interface IForgeEffectInstance
      Parameters:
      curativeItems - The list of ItemStacks being set to the potion effect
    • readCurativeItems

      private static EffectInstance readCurativeItems(EffectInstance effect, CompoundNBT nbt)