Package me.cybersteve.equiplib.util
Class EffectListHelper
java.lang.Object
me.cybersteve.equiplib.util.EffectListHelper
Common helper for equipment.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddEffects(net.minecraft.world.entity.LivingEntity entity, EffectList effects) Overloaded add effects if applying effects to self.static voidaddEffects(net.minecraft.world.entity.LivingEntity entity, EffectList effects, net.minecraft.world.entity.LivingEntity attacker) Add effects of attacker to target entity.static booleancheckIfNeedToApply(net.minecraft.world.entity.LivingEntity entity, EffectList effects) Check if need to apply the effects from EffectList (to prevent flashing).static voidremoveEffects(net.minecraft.world.entity.LivingEntity entity, EffectList effects) Remove effects from entity.
-
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 entityeffects- 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 entityeffects- the effectsattacker- the attacker
-
addEffects
Overloaded add effects if applying effects to self. Since there's no attacker here, null is passed.- Parameters:
entity- the entityeffects- 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 entityeffects- the effects
-