Class EffectData

java.lang.Object
studio.magemonkey.fabled.api.particle.EffectData

public class EffectData extends Object
A collection of effects played on a target
  • Constructor Details

    • EffectData

      public EffectData(EffectTarget target)
      Parameters:
      target - target of each effect
  • Method Details

    • isEffectActive

      public boolean isEffectActive(String key)
      Checks whether an effect is still running
      Parameters:
      key - effect key
      Returns:
      true if running
    • getEffect

      public EffectInstance getEffect(String key)
      Fetches an active effect by key
      Parameters:
      key - effect key
      Returns:
      active effect or null if not found
    • isValid

      public boolean isValid()
      Returns:
      true should keep the data, false otherwise
    • runEffect

      public void runEffect(IParticleEffect effect, int ticks, int level)
      Starts running an effect for the target. If the effect is already running for the target, the running effect will be stopped before the new one is started.
      Parameters:
      effect - effect to run
      ticks - ticks to run for
      level - effect level
    • cancel

      public void cancel(String key)
      Cancels an effect via its associated key
      Parameters:
      key - key of the effect to cancel
    • tick

      public void tick()
      Ticks each effect for the target