Class EffectData
java.lang.Object
studio.magemonkey.fabled.api.particle.EffectData
A collection of effects played on a target
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Cancels an effect via its associated keyFetches an active effect by keyboolean
isEffectActive
(String key) Checks whether an effect is still runningboolean
isValid()
void
runEffect
(IParticleEffect effect, int ticks, int level) Starts running an effect for the target.void
tick()
Ticks each effect for the target
-
Constructor Details
-
EffectData
- Parameters:
target
- target of each effect
-
-
Method Details
-
isEffectActive
Checks whether an effect is still running- Parameters:
key
- effect key- Returns:
- true if running
-
getEffect
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
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 runticks
- ticks to run forlevel
- effect level
-
cancel
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
-