Class EffectListHelper

java.lang.Object
me.cybersteve.equiplib.util.EffectListHelper

public class EffectListHelper extends Object
Common helper for equipment.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addEffects(net.minecraft.world.entity.LivingEntity entity, EffectList effects)
    Overloaded add effects if applying effects to self.
    static void
    addEffects(net.minecraft.world.entity.LivingEntity entity, EffectList effects, net.minecraft.world.entity.LivingEntity attacker)
    Add effects of attacker to target entity.
    static boolean
    checkIfNeedToApply(net.minecraft.world.entity.LivingEntity entity, EffectList effects)
    Check if need to apply the effects from EffectList (to prevent flashing).
    static void
    removeEffects(net.minecraft.world.entity.LivingEntity entity, EffectList effects)
    Remove effects from entity.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EffectListHelper

      public EffectListHelper()
  • Method Details

    • checkIfNeedToApply

      public static boolean checkIfNeedToApply(net.minecraft.world.entity.LivingEntity entity, EffectList effects)
      Check if need to apply the effects from EffectList (to prevent flashing).
      Parameters:
      entity - the entity
      effects - the effects
      Returns:
      the boolean
    • addEffects

      public static void addEffects(net.minecraft.world.entity.LivingEntity entity, EffectList effects, net.minecraft.world.entity.LivingEntity attacker)
      Add effects of attacker to target entity.
      Parameters:
      entity - the entity
      effects - the effects
      attacker - the attacker
    • addEffects

      public static void addEffects(net.minecraft.world.entity.LivingEntity entity, EffectList effects)
      Overloaded add effects if applying effects to self. Since there's no attacker here, null is passed.
      Parameters:
      entity - the entity
      effects - the effects
    • removeEffects

      public static void removeEffects(net.minecraft.world.entity.LivingEntity entity, EffectList effects)
      Remove effects from entity. Effects are passed via EffectList and each effect is only removed from entity if their amplifier matches amplifier in passed EffectList
      Parameters:
      entity - the entity
      effects - the effects